TechBookReport logo

Keywords: Design patterns, object oriented design, Java

Title: Head First Design Patterns

Authors: Eric and Elisabeth Freeman

Publisher: O'Reilly

ISBN: 0596007124

Media: Book

Level: Introductory

Verdict: Nice! Highly recommended.

A fun book about design patterns? It sounds as likely as a fun book on root canal dentistry. But true to form the team behind O'Reilly's 'Head First?' series have gone ahead and produced a design patterns book that is fun to read, full of useful information and makes learning a pleasure rather than a pain.

Following the successful template established by 'Head First Java', this is a book that uses humour, cartoons, puzzles, snappy graphics and plenty else besides to get the information from the page and into your head. It connects with the brain in all kinds of ways so that the reader is kept interested and engaged in the subject. Based on sound cognitive principles rather than gimmicks, the book, like the others in the series, combines novelty and repetition to best effect.

That's enough on the series, what about this particular title? The principle focus of the book is on some of the more fundamental design patterns first documented in the GoF 'Gang of Four' book, ('Design Patterns - Elements of Reusable Object-Oriented Software'). At the same time a key part of the book is about promoting the use of patterns and to sell the idea that patterns provide a shared vocabulary that enables developers to share experience and best practices.

The individual patterns are introduced gently, generally by using a simple example problem that illustrates a problem to be solved. These sample problems are usually deceptively straightforward - a quick solution that works is often the first thing that is explored. When the pitfalls to the obvious solution are explored a new and improved solution is suggested, and this is based on a design pattern. This works well on many levels: firstly it situates patterns in the context of solving real design problems, secondly it highlights the way that patterns are based on a solid set of principles and that they encode best practices in object oriented design.

Another strong point is the very liberal use of code. Where some books on design patterns seem averse to supplying source code examples, this takes a very code-centric view of the world. In the cases where a design pattern already exists as a Java API, for example the Observer pattern/interface, then the authors wisely adopt a build one from scratch approach which is then followed up with examples using the official API. All of this makes for a very practical book, ideal for developers who are interested in making things work rather than in more abstract theorising.

While the book doesn't have the scope of the GoF book, it's still fairly comprehensive. Patterns that are covered include (in no particular order): Strategy, Observer, Decorator, Singleton, Iterator, Composite, Factory, Facade, State, Proxy, Command and Template Method. An appendix provides a very quick run down on a few more that didn't make it into the main text.

Finally, it's worth mentioning that the authors wisely point out that patterns are there to help the design, they are not a substitute for design. In other words they caution the reader to avoid trying to fit patterns everywhere, even when they don't naturally fit.

In conclusion, this is a great book for introducing patterns and it earns the TechBookReport seal of approval with flying colours.

Hit the 'back' key in your browser to return to subject index page

Return to home page

Contents © TechBookReport 2005. Published February 14 2005