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.
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 Defining a Class in The Objective-C 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. To understand Core Data and why you might want to use it, see Core Data Overview.
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.
Last updated: 2009-08-03