Saturday, December 24, 2011

A paragraph about Core Data in Objective C


Model layer of MVC design pattern in iOS is often implemented with Core Data. It is neither a database nor an ORM. It is an object graph that serves as the entire model layer plus the API which allows object serialization and retrieval. In Cora Data, objects are persisted in text files, XML and SQLite databases. When reading objects from storage, it allows the flexibility to filter or sort information as necessary. In this case, Core Data is very similar to sophisticated databases. On the other hand, when it comes to relationship between objects in the object graph, it is a totally different concept from relations in databases. It might be helpful to look at it as relationship between classes in a UML class diagram. It can be very challenging if not fully understood. Using objects’ relationships in a non-standard way might very easily lead to inconsistent states in object graph (More information can be found in Apple Developer Library “Core Data Programming Guide” under Relationships and Fetched Properties/ Unidirectional Relationships).  

No comments:

Post a Comment