Re: Core Data: How best to create a data model for tracking changes to related objects?
Re: Core Data: How best to create a data model for tracking changes to related objects?
- Subject: Re: Core Data: How best to create a data model for tracking changes to related objects?
- From: Scott Stevenson <email@hidden>
- Date: Sun, 11 Feb 2007 21:44:36 -0800
On Feb 11, 2007, at 8:37 PM, Steve Weller wrote:
2. If I create an abstract entity called TrackedItem with a name
and a UUID and make that the parent of Files and Folders then I can
remove the name and UUID from them, and Transaction just has a to-
many relationship with Tracked Item. This seems much simpler.
I agree. This is easier for a number of reasons. There's ultimately
little that separates folders and files, particularly if you consider
file packages, which are folders that just appear to be single files
to the user.
I thought that #2 was the way to go, but I saw this on Chris
Hanson's blog:
[...]
Since I want to be able to store a very large number of Files and
Folders (and other things as well), this is not good. Which of 1
and 2 is best? And is there a third way?
A lot of it depends on how much you need to scale. As a recent post
here pointed out, 10,000 items is not much at all for Core Data. It
also depends on how the data will be used -- how much is searching
versus raw display. Frankly, it's much more likely that other parts
of the application will be slower than fetching unless you're dealing
with immense data sets.
I'd recommended going with the approach that has the simplest
implementation, and only consider the more complicated options of you
find out it's too slow. If it is slow, try to use Shark to figure out
what's going on before you toss out the data model.
These are just my opinions, of course. Others may have different
experiences.
- Scott
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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