Search

Cocoa Design Patterns

Great Price "Cocoa Design Patterns" for $26.99 Today



This has been a very interesting and easy read. This book covers Cocoa design patterns for Mac OS X 10.5, Leopard, as you can see on page xxiv. However, learning the design patterns of Cocoa for Leopard will greatly help your understanding of Snow Leopard and later iterations of Mac OS X. Though it would have been interesting to know of any changes to these design patterns in Snow Leopard, something you might have expected in a 2010 copyright book.

That being said, this book is very easy to read and understand, if you really want to learn Cocoa. Though the learning curve for Cocoa is steep, this book greatly simplifies that process. However, not all the code seems to have been carefully checked for errors.

For example, the terminal colon on a method name taking a parameter was often missing, as you can see on page 212:

[someControl setAction:NSSelectorFromString(@"copy")];

The method "copy:" is very different from "copy". "copy:" takes a parameter while "copy" takes none. A colon in an Objective-C method is part of that method name and indicates a parameter to be inserted after it when invoking the method. A method that takes no parameters has no colons in its name. A method name with any number of parameters has a colon for each parameter and always ends with a colon for the last parameter. The error of leaving out the terminal colon for method names taking a parameter was common in the code in the book.

Another error I found was on page 104 where this method was shown:

- (id) performSelector:(SEL)aSelector
{
IMP methodImplementation = [self methodForSelector:aSelector];
return (*IMP)(self, aSelector);
}

IMP is a function pointer type defined on page 103 as:
typedef id (*IMP)(id self, SEL _cmd, ...);

The error is that the return statement above should be this:

return (*methodImplementation)(self, aSelector);

This error was also from not carefully reviewing the code. It may have been better to test the code before putting it in the book to make sure it compiles and works. If I were to write a book, I think I would copy the code to an IDE first, test it, and then copy it back into the software I would be using to write the book.

However, generally the code is correct, and the code errors are not that unusual for computer books. Also, the book has the right mixture of code and text, and the examples are well thought out. At one point I thought I saw an error, but it was correct. On page 332 in the method + (MYGameHighScoreManager *)sharedInstance I did not see where the static variable myInstance was declared. Then I noticed that it is declared at the top of the code listing on page 331 outside of the @implementation block. Referring to page 154, I found a similar method with the same declaration at the beginning of the method:

static MyGameHighScoreManager *myInstance = nil;

In fact, except for that line the two methods on pages 154 and 332 are identical. The difference is that the method in page 154 declares it within the method statically while the code in page 331 shows the same static declaration made outside both the @implementation and the @interface code blocks, which is the correct way to do it, given the intermixing of C and Objective-C code. Hence, learning Cocoa requires expertise in both Objective-C and C, one reason for the steep learning curve. These languages may be simple to learn, but require a lifetime to master.

Due the code errors I found and for not covering Snow Leopard, I give this book 4 stars, but for the content and the explanations I would give this book 5 stars for the author makes it very easy to read and follow. Overall, I would recommend anyone who wants to learn Cocoa or improve their understanding of it to get this book, and I am glad I bought it. It has increased my understanding and filled many holes in my knowledge of Cocoa, for there really are not many books on the subject.

However, I see on Amazon that newer books are coming out on the subject soon. But I still recommend giving this book a read just to learn the design patterns and to understand how Cocoa works and the proper way to program in it. Whether you are expert at Cocoa or a beginner, you will get a lot out of this book.

Cocoa Design Patterns Features

  • ISBN13: 9780321535023
  • Condition: NEW
  • Notes: Brand New from Publisher. No Remainder Mark.



Rating :
Price : $49.99
Offer Price : $26.99



Cocoa Design Patterns Overviews

“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.

Affordable Price at Store Check Price Now!



Customer Review


Very good, with only a few issues - W. Truppel - Copenhagen, Denmark
Overall, I thought the book was expertly written. It covers a lot of important and interesting aspects of Cocoa, and all its major patterns. The only reasons I'm not giving it 5 stars are:

- there are several errors in the code samples. Occasional bugs are inevitable, but non-compiling code is inexcusable and a major disappointment, for a book of this nature;
- its coverage of the Singleton pattern is incomplete, considering that it doesn't discuss Apple's own recommendations on how to implement a singleton;
- no discussion of patterns related to thread safety;
- the discussion of HOMs (higher order messages) is interesting, but it strikes me as something rarely used; I'd have preferred if the author had used the space spent on HOMs to discuss something more practical. For instance, a common application of the Proxy pattern is the asynchronous loading of images off the web. I think that would have been more useful;
- later chapters are very repetitive, and much less concrete in actual usage, than earlier ones. For instance, chapters 28 (Managers), 29 (Controllers), and 32 (Bindings and Controllers) have a lot in common, and that commonality is repeated in all 3 chapters. Chapter 31 (Application Kit Views) is a repetition of material covered in several previous chapters and adds nothing new.

I'm a great fan of Design Patterns and think that the Gang of Four book (Design Patterns: Elements of Reusable Object-Oriented Software) is still the best book on the subject. However, it's focused on C++ and not on Objective-C and Cocoa. This book, despite its faults, is a worthy partner to the Gang of Four book and is a great addition to any Cocoa programmer's library.


Absolute Must-Read - Innocente -
There are a few core books that I consider must-read books for starting Mac / iPhone developers. This is one of them.

It is especially important for current or former Language / Framework programmers to study this book, and study it hard.

Nothing is more obvious than code that has been architected by old C++ / .NET / MFC coders that do not 'get' the Cocoa Design Patterns.

Don't be one of those folks.

This applies to Java, C#, Smalltalk, C, C++, Delphi, etc coders. These Design Patterns MUST be learned, and used.



Related to Items You've Viewed




*** Product Information and Prices Stored: May 12, 2010 04:52:05


Friends Link : BUY "GPS Watches" NOW!! Buy "iPad, iPhone and iPod Touch Programming" Book Best iPhone Programming Textbooks Best Deals And Reviews On Objective-C Beginners Books Best Deals And Reviews On Beach Flip Flops

No comments:

Post a Comment