Book Review: Head First Design Patterns

Posted on: Tuesday, December 11th, 2007 at 5:00 pm

Book details

  • Book: Head First Design Patterns
  • Authors: Eric Freeman, Elisabeth Freeman, Kathy Sierra and Bert Bates
  • Publisher: O’Reilly (November 2004)
  • Purchase the book:

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.

Book contents

Table of contents are as follows:

  1. Welcome to design patterns: an introduction
  2. Keeping your Objects in the know: the Observer Pattern
  3. Decorating Objects: the Decorator Pattern
  4. Baking with OO goodness: the Factory Pattern
  5. One of a kind Objects: the Singleton Pattern
  6. Encapsulating Invocation: the Command Pattern
  7. Being Adaptive: the Adapter and Facade Patterns
  8. Encapsulating Algorithms: the Template Method Pattern
  9. Well-managed Collections: the Iterator and Composite Patterns
  10. The State of Things: the State Pattern
  11. Controlling Object Access: the Proxy Pattern
  12. Patterns of Patterns: Compound Patterns
  13. Patterns in the Real World: Better Living with Patterns
  14. Appendix: Leftover Patterns

The first chapter also introduces the Strategy Pattern.

The leftover patterns also have decent descriptions for the following patterns:

  • Bridge
  • Builder
  • Chain of Responsibility
  • Flyweight
  • Interpreter
  • Mediator
  • Memento
  • Prototype
  • Visitor

The good

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

The bad

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!)

The ugly

Nothing

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:

  1. 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
  2. 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

Share this

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Furl
  • Ma.gnolia
  • NewsVine
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Facebook

About this post

Post Navigation

Post a Comment