let config = DatabaseConfiguration.Builder().setDirectory("/foo/bar").build()
let config = DatabaseConfiguration(directory: "/foo/bar")
let config = DatabaseConfiguration()
config.directory = "/foo/bar"
On Jan 24, 2018, at 2:59 PM, Ben Kennedy <ben.k...@kashoo.com> wrote:
This seems like an insanely baroque syntax. Is it the correct way?
let config = DatabaseConfiguration()
config.directory = "/foo/bar"
> Therefore it is incorrect to expect that modifying a struct -- a copy of which was previously handed to another object -- should have any future effect.
On Jan 24, 2018, at 4:17 PM, Ben Kennedy <ben.k...@kashoo.com> wrote:
On Jan 24, 2018, at 3:54 PM, Jens Alfke <je...@couchbase.com> wrote:
When there are a lot of optional properties for creating an object, it gets awkward to stuff all of them into one constructor/initializer method, so you create an object to hold the properties and then pass that to the constructor.
I agree with the principle, and am on board with the notion of a configuration object. But having to chain together a pile of methods to populate it, rather than simply exposing properties, feels needlessly unwieldy in my opinion.
Perhaps it's is a known issue, but the examples currently shown at https://url.emailprotection.link/?at5deUC_Tu3W-ZIIVdGCs1A9ZdNafh6GrLbBKCNkHC1UWV3cfBQQuBy5ij3LUHc8FHg9yCo7duB-SdiX7LE3Bw13CZ3bLtk5fKuoK72Kq2hc5sfLXWlme5hQmRQq8NcGb don't work. For example, to set up a replicator, it seems I'm forced either to use the method-chaining builder pattern previously discussed, or else use the "CBL-" named counterparts:
let config = ReplicatorConfiguration(database: cblDatabase, target: URLEndpoint(url: url)) // fails; no initializer available for ReplicatorConfiguration
let config = CBLReplicatorConfiguration(database: cblDatabase, target: CBLURLEndpoint(url: url)) // works
I'm a little confused as to why the CBL-named classes and the non-CBL (Swift-named) classes are even available. (It's a Swift-only project so far, and I've imported CouchbaseLiteSwift via CocoaPods. I would have though that bridging would have removed a layer of the redundancy, but admittedly I'm not too expert in ObjC/Swift bridging.)
Yeah, it was like this recently. But some developers would modify the configuration after creating the Database from it, and then asking why their configuration wasn’t applied.
But DatabaseConfiguration is a struct, and in Swift, structs have "value" semantics. Therefore it is incorrect to expect that modifying a struct -- a copy of which was previously handed to another object -- should have any future effect. Accordingly, it seems unreasonable to penalize the programmer at init time in order to protect against such a mistake.
-ben
--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://url.emailprotection.link/?acI2QHOlLUu5r3fIWsg0FuhkF2e47DmK1vgOYPYmLg0Klkq3k-e350TEq7W8IuGwl2Uo3eLQjo_Bu_eHXSFq5WAqW_ZZY2NVnZnHzf9gzBrXoE5TNDGd2D4Nbt75Gs8T956kZ8E4OVauY4jPiTaR3yfnfa4WMcd1y-bqqb_mL7J0~.
For more options, visit https://url.emailprotection.link/?acI2QHOlLUu5r3fIWsg0FukefuYIqVJU2gt8_envaf_7bRGVAePvclKgGlI5iD7VjZEtCv8mJsYVLH4A0CyroQQ~~.
Perhaps it's is a known issue, but the examples currently shown at https://developer.couchbase.com/documentation/mobile/2.0/couchbase-lite/swift.html don't work.
(Incidentally, speaking of documentation, there appear to be a couple of notable errors in the setup guide for SG 1.5 relating to support for CBL 2.0 replication. I submitted feedback via the page; see https://issues.couchbase.com/browse/DOC-3194.)
Hey Paul
We are planning on going GA in the next month or so (exact timeline TBD). So 2.0 is pretty much feature complete and the focus right now is code hardening.
Since you are just starting off , worthwhile noting that there have some important bug fixes and API enhancements since DB021. So your options are (a) start with DB021 to get a good feel for the API (b) wait for our next release (should be out reasonably soon) or (c) pull and build from source directly to get the latest and greatest.
We would love to get your feedback on 2.0 and whether it handles your thread safety issues…
Regards
-Priya
From:
<paul....@sadasystems.com>
Date: Friday, February 2, 2018 at 6:16 PM
To: Couchbase Mobile <mobile-c...@googlegroups.com>
Subject: Re: Announcing Release of Couchbase Lite 2.0 Developer Build 21 (DB 21)
Congratulations (and hi), I'm excited to start working with Couchbase 2 if the time is right, as the threading issues with Couchbase 1.4 have been.. challenging. I know this is a very subjective question but, roughly how stable is this code now? Would you use it in a production environment? Or if not, does it feel close? I'm growing tired of crashes related to multiple threads accessing the database at the same time and I can either go through and put everything in queues (not sure yet if NSOperation or dispatch), or try switching to 2.0 which I expect I'd end up doing in time anyway.
Thanks in advance for any opinions or info anyone with relevant experience would like to share.
On Thursday, December 21, 2017 at 6:52:52 AM UTC-8, Priya Rajagopal wrote:
Paul Jacobs
Senior iOS Developer | Geo - ATOM
SADA Systems
Direct: 805-358-7634 | SADASystems.com
Cloud Computing | Consulting | Managed Services | App Development
Google Partner of the Year: 2013 | 2014 | 2015 | 2016
On Jan 30, 2018, at 12:45 PM, Ben Kennedy <ben.k...@kashoo.com> wrote:When retrieved in 2.0, I see the "_attachments" property on the document. However, I can't figure out how to acquire the blob using the new API. Neither using the attachment name nor property name as the argument for document.blob(forKey:) works; both return nil.
On Feb 2, 2018, at 3:16 PM, paul....@sadasystems.com wrote:I'm growing tired of crashes related to multiple threads accessing the database at the same time and I can either go through and put everything in queues (not sure yet if NSOperation or dispatch), or try switching to 2.0 which I expect I'd end up doing in time anyway.