-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce a new NSManagedObject subclass to (eventually) support full JSON documents #216
Comments
Did you see But I haven't thought about this in quite awhile. |
Sorry I didn't write So the rest of the client would and does work with the This change is uniquely for Core Data stores since you can only work with semi-scalar attributes or full relationships, but not embedded relationships. So we have to model a single bucket across multiple Core Data entities. I assume |
Interesting, I think this is the inverse of a feature @fredrocious has considered (mapping multiple buckets to a single entity). Anyway, I think I see what you mean now. As for the other stuff, doing it incrementally makes sense and could be divided something like:
Plus unit tests for each of these steps. |
|
Then again perhaps |
Any names with "document" probably aren't great due to other connotations (like Core Data documents). All the The only I took this approach anticipating we'd add more types over time, some of which need specific libraries (like DiffMatchPatch), with the goal of keeping the code separate and allowing subclassing. See Yet, unifying diffing across the libraries (with common unit tests) remains a good goal. A change might be in order if only for that. @jleandroperez probably has some thoughts. |
The main thing I wanted to figure out with this issue was, regardless of naming, whether it would be better in the long term to have:
or:
We can create separate issues for tackling any diffing etc. stuff. |
Out of all the things that need to change in order to support full JSON documents with nested JSON structures, The first step that can happen independently is to be able to distinguish between Core Data entities that represent top-level objects, and entities that represent nested objects.
I propose changing:
to:
This naming and class hierarchy is analogous to document-object-model class structure, i.e. everything is a Simperium element (DOM node) and the top-level entity is also the Simperium bucket object itself (DOM document).
Currently in happy-inspector:embedded-objects we just added
SPEmbeddedManagedObject
parallel toSPManagedObject
, but I think it's awkward. It also leads to some code duplication in that branch, i.e. there are two completely independent code paths for fetching objects and ensuring each object has a Simperium key.The text was updated successfully, but these errors were encountered: