Re: Multi-storage Core Data
Re: Multi-storage Core Data
- Subject: Re: Multi-storage Core Data
- From: Ben Trumbull <email@hidden>
- Date: Thu, 22 May 2008 13:06:14 -0700
At 9:54 AM -0700 5/22/08, email@hidden wrote:
> A MOC is associated with a persistent store coordinator. A PSC can
have multiple stores associated with it.
What you do not get for free is cross-store relationships.
Which is how I understood it, and I'm willing to write some glue here.
But do you have any pointers on how to get started with that? I
haven't been able to figure out with a multi-store PSC, how to direct
some objects to one store and others to another. Examples of using
fetched properties to create cross-store relationships are also seems
pretty thin in the main docs. Are there any good references on Core
Data beyond the fairly straight-forward Department app?
In /Developer/Examples/CoreData is the iClass example which
demonstrates cross store relationships. It's a bit dated, so using
transformable properties might clean things up. But it shows the
issues involved.
In addition to use the URI form of an NSManagedObjectID, you could
assign UUIDs to your objects and reconstitute the cross store
relationships by fetching them. Using URIs will be faster
(leveraging Core Data's faulting & caching mechanism) but using your
own UUID attribute will let you do things like copy the data to
another store (like via drag & drop in a document) and copy it back,
and still maintain the object's "identity" in your own application
specific meaning.
Aperture does something like that so people can export records, share
them, and reimport them and have the original library understand that
these are updated records instead of new records.
Using Core Data's URIs only preserves identity to the (store, entity,
object) tuple, so copy the data to a different store gives it a new
identity.
It looks like there have been many CD improvements in Leopard
(transformable attributes being the one that really jumps out to me).
It looks like it may be time for me to re-read all the docs and try
again with the new 10.5 features.
There were a lot of improvements to Core Data in 10.5. Transformable
properties, dynamic properties, schema migration, a public atomic
store API, innumerable performance enhancements, 64 bit & garbage
collection support, and many new options on NSFetchRequest.
<http://developer.apple.com/releasenotes/Cocoa/CoreDataReleaseNotes/>
--
-Ben
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden