On this page:
My Summary: 5 out of 5
For a book with about 650 pages, I got through this really quickly (for me, that is — about 8 hours)!
That should hopefully help summarize my view that I really liked this book.
An excerpt from the back cover answers the question, “What’s so special about this book?”:
We think your time is too valuable to spend struggling with new concepts. Using the latest research in cognitive science and learning theory to craft a multi-sensory learning experience, Head First Design Patterns uses a visually rich format designed for the way your brain works, not a text-heavy approach that puts you to sleep.
— Head First Design Patterns
Using funny examples like duck simulators and gumball machines instead of some technical, boring algorithm or graphical windows application meant it was likely to be more memorable, and, crucially, not get bogged down in details about the application at hand, but the pattern being demonstrated.
The example code is in Java. I have been using .NET/C# as my main programming language at work the past 4 or 5 years, but this is no problem at all, as C# and Java are very similar, syntactically.
Table of contents are as follows:
- Welcome to design patterns: an introduction
- Keeping your Objects in the know: the Observer Pattern
- Decorating Objects: the Decorator Pattern
- Baking with OO goodness: the Factory Pattern
- One of a kind Objects: the Singleton Pattern
- Encapsulating Invocation: the Command Pattern
- Being Adaptive: the Adapter and Facade Patterns
- Encapsulating Algorithms: the Template Method Pattern
- Well-managed Collections: the Iterator and Composite Patterns
- The State of Things: the State Pattern
- Controlling Object Access: the Proxy Pattern
- Patterns of Patterns: Compound Patterns
- Patterns in the Real World: Better Living with Patterns
- Appendix: Leftover Patterns
The first chapter also introduces the Strategy Pattern.
The leftover patterns also have decent descriptions for the following patterns:
- Chain of Responsibility
All sorts of good things in the book, including:
- Funny examples — making it more memorable
- Simple examples — letting you understand the pattern, and avoid worrying about the technicalities of the scenario
- Side notes, pictures, exercises — encouraging you to write things down, and think about things
- Imaginary conversations, repetition of points through different analogies and examples — reinforcing what you have learned
- Reviews and summaries that build up chapter after chapter — further reinforcement
Couldn’t think of anything bad about the book — maybe that it is big and heavy, and that it would be nice if all the left over patterns got the same treatment (then I could update this “bad” section to say it is about 1000 pages!)
Get the book
If you want to purchase it, or see more info (including reviews by others), look at the Amazon web site (note if you purchase the book via this site, then I will get a referral fee/bonus from Amazon’s associates programme).
These are similar books I have read on this topic:
- Design Patterns; Elements of Reusable Object-Oriented Software, by Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides (Addison Wesley, 1995). Some additional details:
- This is regarded as the “classic” or original patterns book by the Gang of Four (also referred to as Gof).
- It is well structured, grouping the various patterns into creational, structural, and behavioral patterns.
- It uses a mixture of C++ and SmallTalk examples.
- It is more formal and “dry” compared to Head First Design Patterns so took me a lot longer to get through, but is still good.
- If I had to rate this, then I’d probably give it something like 3.5 or 4 out of 5.
- Get more info from Amazon UK or from Amazon USA
- C# Design Patterns; A Tutorial, by James W. Cooper (Addison Wesley, 2003). Some additional details:
- This book, as the name suggests, is specifically geared towards C# developers.
- While C# 2.0 has come out since (with support for Generics etc) many of the techniques still apply.
- Quite a lot of the book goes into explaining Object Oriented Programming, and C# language features which most seasoned C# developers could skip.
- It is a bit dry and sometimes uses examples related to drawing desktop graphical applications or mathematics, so some of those details get in the way of explaining/highlighting the pattern.
- In places it also uses Java-like conventions (such as code formatting and getter/setter methods rather than C# properties).
- If I had to rate this, then probably 3 out of 5 (or, now that I have read Head First Design Patterns I might knock this one down to 2 out of 5 for comparison!).
- Get more info from Amazon UK or Amazon USA