Re: Core Data using only one object
Re: Core Data using only one object
- Subject: Re: Core Data using only one object
- From: "Corey O'Connor" <email@hidden>
- Date: Tue, 24 Apr 2007 14:55:12 -0700
On 4/24/07, Steve Israelson <email@hidden> wrote:
Where is that documented?
Those words are likely not documented exactly, but are implied.
I have been struggling with trying to figure out when CoreData will
make things easier. Trying to figure out if ALL my instance variables
can be in CoreData etc. Some clear explanation of how and why to use
it in various real work scenarios would be handy.
Try google for this. There are a variety of examples.
I'll give an (innacurate) stab though: First: CoreData provides a
persistent storage system. That, in itself is nothing special.The
advantage of CoreData is that it provides an interface to stored data
that is equivelent (On many levels) to the interface to an in-memory
object graph. There are restrictions to what object graphs CoreData is
effective at providing a persistent storage system for. These are
detailed somewhere in Apple's docs. Still, for the most part: If it's
easy to describe the classes and and associations between classes in
an application with CoreData's managed object model designer then
CoreData is a good system to use.
Not considering optimization, a metric I use to determine if an
instance variable should be stored or derivied is to evaluate the data
flow of dependents. I try only to store the bare minimum of instance
variables required to reconstruct all the data in memory. For
instance, I have an application that lets people chop up a PDF
document. The instance variables of one class are:
* Path to PDF document
* CGPDFDocumentRef
Should I store both of these in a Core Data store? In my case the
answer is no: Just store the Path variable and reconstruct the other
lazily.
--
-Corey O'Connor
_______________________________________________
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