NSManagedObjectModel has references to zero or more NSEntityDescription objects. Each NSEntityDescription has references to zero or more NSPropertyDescription objects. NSPropertyDescription is an abstract class with three concrete implementations This small set of classes is enough to define any object model you will use when working on your Core Data projects.
History -wiki• Early 1990, NeXT created an Abstraction abovedatabases (DBKit-92)• DBKit failed, in 94 a complete rewrite came asform of EOF (4 people team!) – read only• EOF2.0 in 95 – Context Editing• EOF was useful for WWW and web apps• In 96 first OO webserver WebObjects launchedwith EOF at its heart• 2005, EOF returns to OSX Tiger as Core Data• June 2009 Released for iPhone OS 3.0
EOF -wiki• Database tables are mapped to classes.• Database columns are mapped to classattributes.• Database rows are mapped to objects (or classinstances)• Can leverage inheritance• EO is a class which models a physical orconceptual object in the business domain.
What is Core Data –Apple Doc.• Core Data is a schema-driven object graphmanagement and persistence framework.Fundamentally, Core Data helps you to savemodel objects (in the sense of the model-view-controller design pattern) to a file and getthem back again. This is similar to archiving,but Core Data offers much more than that.
What is Core Data –Apple Doc.• Provides an infrastructure for managing all thechanges to your model objects. This gives youautomatic support for undo and redo, and formaintaining reciprocal relationships betweenobjects.
What is Core Data –Apple Doc.• Allows you to keep just a subset of your modelobjects in memory at any given time. This isespecially important on iOS where conservingmemory is critical.• Allows you to maintain disjoint sets of edits ofyour objects. This is useful if you want to, forexample, allow the user to make edits in oneview that may be discarded without affectingdata displayed in another view.
What is Core Data –Apple Doc.• Uses a schema to describe the model objects.You define the principal features of your modelclasses—including the relationships betweenthem—in a GUI-based editor. This provides awealth of basic functionality “for free,”including setting of default values and attributevalue validation.
What is Core Data –Apple Doc.• Has an infrastructure for data store versioningand migration. This lets you easily upgrade anold version of the user’s file to the currentversion.
In ActionUserCodeNSFetchRequestMOMOCPersistent SoreCoordinatorn1Persistent Sore momd
Under the Hood• Core Data applications requires an ObjectModel (NSManagedObjectModel)– Model defines entities (NSEntityDescription)Entities have three kind of Properties(NSPropertyDescription):• Attributes (NSAttributeDescription)• Relationships (NSRelationshipDescription)• Fetched Properties (NSFetchedPropertyDescription)