This is the first review I've written on amazon, even though I have bought tons of stuff here, both great and awful. I decided to get on and write on for this book because it's one of the best purchases I've made with respect to nonfiction programmer references, if not the best. It's a near-perfect example of the way a programming book should be written, in my opinion, and I reference this book all the time. It is the most "reusable" book on cocoa development that I own, by that I mean - I can reference it over and over for various projects and goals, always finding something of use in the book. Because the author takes a more conceptual approach (design patterns) it results in a deeper understanding (at least for me) of these patterns and how to implement them in my own work. Thus, I wanted to make sure everyone who is looking for a book that covers these topics (and it should be everyone who is learning cocoa - the patterns are extremely ubiquitous, and they are absolutely, absolutely concepts every good cocoa programmer should be very familiar with). It's written incredibly well, in an easy-to-follow and easy-to-understand manner - I can quickly get through a chapter, or reference one when I need to brush up, extremely quickly and without having to spend a bunch of time going through filler material like I sometimes have to do with other programming reference books I own. I'm very cautious about buying programming references because you truly never know what you're going to get, or if it really ends up applying to you, as they vary so much in the way they are written and the skill level for which they are written. I found this book, though, to be accessible but not written in a way that doesn't assume the reader is both a novice and dumb (something I seem to find way too often). Great book, great book. Mine is worn out from all the use it has gotten, I have notes scribbled throughout, and I find myself sticking it in my backpack and carrying it everywhere; I think if you want to write good code, clean code, *reusable code*, and want/need a good model of the best route to take, get this book. Even if you understand conceptually how a lot of these things are done (I did, for the most part, when I bought the book), it really helps to have it in this format (and in the way the author took writing the book) because he does an incredible job of getting to the core of _what you need and why you need it_ - so you both never forget a key item in a certain implementation goal, and you take the best route to get what you want from the design pattern. It gives me a great deal of reassurance as I write my code with the goal of reusability and writing great code, that I'm doing so in the best possible way. A 5 star book if there ever was one. Table of Contents......Page 9 I: One Pattern to Rule Them All......Page 30 1 Model View Controller......Page 31 MVC in Cocoa......Page 33 Summary......Page 44 Non-MVC Design......Page 46 MVC Design......Page 51 Summary......Page 56 II: Fundamental Patterns......Page 57 Motivation......Page 58 Solution......Page 60 Examples in Cocoa......Page 67 Consequences......Page 71 Motivation......Page 72 Solution......Page 73 Examples in Cocoa......Page 76 Consequences......Page 80 Solution......Page 82 Examples in Cocoa......Page 90 Consequences......Page 91 Motivation......Page 92 Solution......Page 93 Examples in Cocoa......Page 99 Consequences......Page 103 Solution......Page 106 Consequences......Page 113 Solution......Page 114 Consequences......Page 126 9 Perform Selector and Delayed Perform......Page 128 Solution......Page 129 Examples in Cocoa......Page 133 Consequences......Page 135 10 Accessors......Page 136 Solution......Page 137 Examples in Cocoa......Page 148 Consequences......Page 151 Motivation......Page 152 Solution......Page 153 Examples in Cocoa......Page 156 Consequences......Page 163 Motivation......Page 164 Solution......Page 167 Examples in Cocoa......Page 168 Consequences......Page 175 III: Patterns That Primarily Empower by Decoupling......Page 176 Solution......Page 177 Examples in Cocoa......Page 186 Consequences......Page 187 14 Notifications......Page 188 Solution......Page 189 Examples in Cocoa......Page 197 Consequences......Page 201 Motivation......Page 204 Solution......Page 208 Consequences......Page 218 Solution......Page 220 Consequences......Page 234 17 Outlets, Targets, and Actions......Page 235 Solution......Page 236 Examples in Cocoa......Page 244 Consequences......Page 247 Solution......Page 249 Examples in Cocoa......Page 259 Consequences......Page 260 Solution......Page 261 Examples in Cocoa......Page 265 Consequences......Page 269 Solution......Page 271 Consequences......Page 283 Solution......Page 284 Examples in Cocoa......Page 286 Consequences......Page 291 Solution......Page 292 Examples in Cocoa......Page 293 Consequences......Page 296 Motivation......Page 297 Solution......Page 299 Examples in Cocoa......Page 300 Consequences......Page 302 IV: Patterns That Primarily Hide Complexity......Page 303 Motivation......Page 304 Solution......Page 305 Examples in Cocoa......Page 307 Consequences......Page 310 25 Class Clusters......Page 311 Solution......Page 312 Examples in Cocoa......Page 317 Consequences......Page 329 26 Façade......Page 331 Solution......Page 332 Examples in Cocoa......Page 336 Consequences......Page 340 Solution......Page 341 Consequences......Page 356 Solution......Page 357 Examples in Cocoa......Page 364 Consequences......Page 365 29 Controllers......Page 366 Solution......Page 367 Examples in Cocoa......Page 389 Consequences......Page 391 V: Practical Tools for Pattern Application......Page 393 30 Core Data Models......Page 394 Core Data Terminology......Page 395 Collaboration of Patterns Within Core Data......Page 397 Core Data Limitations and Benefits......Page 406 The Role of the View Subsystem......Page 408 Collaboration of Patterns Within Application Kit......Page 409 Application Kit Limitations and Benefits......Page 421 Role of Bindings and Controllers......Page 422 Collaboration of Patterns Within Bindings and Controllers......Page 426 Bindings and Controllers Limitations and Benefits......Page 431 Apple Documentation......Page 433 Mailing Lists......Page 434 Conferences/Training......Page 435 A......Page 436 C......Page 438 D......Page 442 G......Page 444 I......Page 445 L–M......Page 446 N......Page 448 O......Page 450 P......Page 452 Q–R......Page 453 S......Page 454 W......Page 455 X–Z......Page 456
“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.
"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, Incorporated, 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