Overview
“Next time some kid shows up at my door asking for a code review, this is the book that I am going to throw at him.”
–Aaron Hillegass, founder of Big Nerd Ranch, Inc., and author of Cocoa Programming for Mac OS X
Unlocking the Secrets of Cocoa and Its Object-Oriented Frameworks
Mac and iPhone developers are often overwhelmed by the breadth and sophistication of the Cocoa frameworks. Although Cocoa is indeed huge, once you understand the object-oriented patterns it uses, you’ll find it remarkably elegant, consistent, and simple.
Cocoa Design Patterns begins with the mother of all patterns: the Model-View-Controller (MVC) pattern, which is central to all Mac and iPhone development. Encouraged, and in some cases enforced by Apple’s tools, it’s important to have a firm grasp of MVC right from the start.
The book’s midsection is a catalog of the essential design patterns you’ll encounter in Cocoa, including
- Fundamental patterns, such as enumerators, accessors, and two-stage creation
- Patterns that empower, such as singleton, delegates, and the responder chain
- Patterns that hide complexity, including bundles, class clusters, proxies and forwarding, and controllers
And that’s not all of them! Cocoa Design Patterns painstakingly isolates 28 design patterns, accompanied with real-world examples and sample code you can apply to your applications today. The book wraps up with coverage of Core Data models, AppKit views, and a chapter on Bindings and Controllers.
Cocoa Design Patterns clearly defines the problems each pattern solves with a foundation in Objective-C and the Cocoa frameworks and can be used by any Mac or iPhone developer.
Synopsis
Much of the technology embodied by Apple's Cocoa software development frameworks have been in commercial use since 1988, and in spite of many years of use, the Cocoa frameworks are still revolutionary. Cocoa technology has been marketed with a variety of names including NeXTstep, OpenStep*, Rhapsody, and Yellow Box. In recent years, Apple has expanded the frameworks dramatically and added new tools to raise the bar for Cocoa programmer productivity beyond its already famously high levels.
Programmers are often overwhelmed by the breadth and sophistication of Cocoa when they first start using the frameworks. Cocoa is huge, but it’s also elegant in its consistency and simplicity which result from the application of patterns throughout its design. Understanding the patterns enables the most effective use of the frameworks and serves as a guide for writing your own applications.
This book explains the object-oriented design patterns found in Apple’s Cocoa frameworks. Design patterns aren't unique to Cocoa; they're recognized in most reusable software libraries and available in any software development environment. Design patterns simply identify recurring software problems and best practices for solving them. The primary goal of this book is to supply insight into the design and rationale of Cocoa, but with that insight, you'll be able to effectively re-use the tried and true patterns in your own software - even if you aren't using Cocoa.