With every successive release of Mac OS X, the basic functionality Cocoa provides has increased—particularly with technologies such as bindings and Core Data. This document describes in detail aspects of design and implementation that you need to take advantage of the features Cocoa offers.
Who Should Read this Document
Organization of This Document
This document addresses questions such as, what are model objects? what do they do? what do you have to do to implement a model class? and why is this important?
You should read this document to learn how to implement Cocoa model classes.
You are expected to be familiar with Cocoa standards, conventions and so on as described in Naming Conventions and the section entitled "Defining a Class" in The Objective-C 2.0 Programming Language (for example, class names should start with a capital letter; instance variable names should start with a lower case letter; instance variables should not be public, and so on). In implementing a model object, you should adhere to the Model View Controller (MVC) design pattern as described in The Model-View-Controller Design Pattern) and the Object Modeling section in Cocoa Design Patterns.
The following articles describe the features a model object might have and explain why and how you might implement them:
“Checklist and Design Considerations” provides a checklist of features that a model object might have, and reasons why you should consider implementing them.
“Basic Accessor Methods” describes how to implement accessor methods for standard model objects.
Managed Object Accessor Methods describes how to implement accessor methods for Core Data's managed objects.
“Key-Value Technology Compliance” describes how to ensure that your model objects support key-value coding and key-value observing, and describes how to register dependent keys.
“Model Object Validation” describes how to implement validation methods.
“Initialization” describes how to customize the initialization of model objects.
“Archiving” describes how to support archiving.
“Copying” describes how to support copying.
© 2008 Apple Inc. All Rights Reserved. (Last updated: 2008-02-08)