On Mar 3, 2008, at 8:31 AM, Jason Kravitz wrote:

So given the 3 options in this article, any guidelines for when one is
more beneficial than another?

It depends primarily on your situation.

   * You can create the managed objects directly in code (as
trivially illustrated in NSPersistentDocument Core Data Tutorial).


If you can easily generate the data programmatically, then this may be most efficient. But it may be the least flexible approach with highest maintenance cost.

   * You can create a property list—or some other file-based
representation—of the data, and store it as an application resource.
When you want to use it, you must open the file and parse the
representation to create managed objects.

For non-trivial data which you may want to update periodically, this may be the easiest approach -- unless you also need to create relationships between the objects which may be more difficult to represent. Given a simply-structured text file or plist, you can easily see and edit the contents.

   * You can create a separate persistent store that contains the
default data. When you want to use it, you must copy the objects from
the defaults store to the newly-created store.

This is in some respects the most complex, since you have to copy managed objects from one store to another -- and you have to make sure you update the store every time you alter your schema -- but offers most flexibility. Although in some cases this might be the easiest approach of al if you can simply copy the default store as a file to the new location.

mmalc

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to