Design Patterns and how I’m studying them

Design patterns are common solutions to recurring problems. The concept originally came from architecture, but has had a great impact on object-oriented software design. There are a number of books covering software design patterns, the original being Design Patterns: Elements of Reusable Object-Oriented Software, by Gamma, Helm, Johnson and Vlissides, often referred to as the “Gang of Four.” The most accessible book I’ve read is Head First Design Patterns, by Eric and Elisabeth Freeman with Kathy Sierra and Bert Bates.

I don’t recommend Cocoa Design Patterns as your first design patterns book; Head First Design Patterns will be a better choice. Even though the Head First book’s examples are in Java, I was able to convert them to C++ without any significant problems. I haven’t read the Gang of Four’s book, so I’m interested hearing about that book from commenters.

Buck & Yacktman cover design patterns as used in Cocoa programming. The fundamental pattern is the Model-View-Controller pattern that is the basis of most GUI programming, but they show up throughout Cocoa at every level, starting with object creation (chapters 3 and 5), going data structures (chapter 7), all the way through storing application data (chapter 24) and document data (chapter 11).

The book has sample programs available here, but many chapters have code snippets that aren’t a part any of those programs, and I’d like to get as many of these into executing code as possible. Even though the code is online, I recommend typing it in yourself. This has two advantages: every character will go through your fingers (no glossing over all the little details that you need to take care of in your own code), and you’ll have to debug any problems that the typos cause. Since you’ll be facing the same issues in your own programs, it’s good practice.

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s