4. History -wiki
• Early 1990, NeXT created an Abstraction above
databases (DBKit-92)
• DBKit failed, in 94 a complete rewrite came as
form 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 launched
with EOF at its heart
• 2005, EOF returns to OSX Tiger as Core Data
• June 2009 Released for iPhone OS 3.0
5. EOF -wiki
• Database tables are mapped to classes.
• Database columns are mapped to class
attributes.
• Database rows are mapped to objects (or class
instances)
• Can leverage inheritance
• EO is a class which models a physical or
conceptual object in the business domain.
7. What is Core Data –Apple Doc.
• Core Data is a schema-driven object graph
management and persistence framework.
Fundamentally, Core Data helps you to save
model objects (in the sense of the model-view-
controller design pattern) to a file and get
them back again. This is similar to archiving,
but Core Data offers much more than that.
8. What is Core Data –Apple Doc.
• Provides an infrastructure for managing all the
changes to your model objects. This gives you
automatic support for undo and redo, and for
maintaining reciprocal relationships between
objects.
9. What is Core Data –Apple Doc.
• Allows you to keep just a subset of your model
objects in memory at any given time. This is
especially important on iOS where conserving
memory is critical.
• Allows you to maintain disjoint sets of edits of
your objects. This is useful if you want to, for
example, allow the user to make edits in one
view that may be discarded without affecting
data displayed in another view.
10. What is Core Data –Apple Doc.
• Uses a schema to describe the model objects.
You define the principal features of your model
classes—including the relationships between
them—in a GUI-based editor. This provides a
wealth of basic functionality “for free,”
including setting of default values and attribute
value validation.
11. What is Core Data –Apple Doc.
• Has an infrastructure for data store versioning
and migration. This lets you easily upgrade an
old version of the user’s file to the current
version.
12. Core Data Components
User
Managed Object Context
(managed object) (managed
object)
Persistent Store
Coordinator
Storage Storage Storage
15. Under the Hood
• Core Data applications requires an Object
Model (NSManagedObjectModel)
– Model defines entities (NSEntityDescription)
Entities have three kind of Properties
(NSPropertyDescription):
• Attributes (NSAttributeDescription)
• Relationships (NSRelationshipDescription)
• Fetched Properties (NSFetchedPropertyDescription)
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.