Properly copying an object poses some questions, the most important of which is whether to make a shallow or deep copy. If an object has pointers to other objects, a shallow copy of the object contains pointers to the same objects as the original, while a deep copy involves making copies of the objects that the original pointers refer to.
Archiving makes deep copies, since all the pointed-to objects have to be stored in the archive so they can then be restored, probably to different memory locations than the originally.
The first two example programs in this chapter are command-line tools, which take ~5 minutes each to type in and run. The other examples also come from WordPuzzle.
This chapter ends the section on Fundamental Patterns, the ones that are basic to any Cocoa program. The next section covers patterns for decoupling objects so that they aren’t unnecessarily interdependent.