Head First Design Patterns

by John Turner

Posted on November 19, 2009


Design Patterns: Elements of Reusable Object-Oriented Software’ by Gamma et. al. is a book credited with popularising design patterns and is probably still today the most popular on the subject. The book itself provides an introduction to design patterns, how they should be presented and the well known design patterns catalog. Each design pattern is presented in a consistent manner, describing different aspects of the pattern such as name, intent, motivation, structure, consequences etc.

I find the book a very good reference as it is very concise, but this is exactly the reason I found it difficult to use as an introduction to design patterns.

Several year’s ago I was introduced to the ‘Head First’ series of books which O’Reilly describe as ‘A Brain Friendly Guide’. This series of books use a very distinct method of presenting material that encourage the reader to engage with the material through posing questions, repeating key information, using visual aids and a conversational style of communication. It took me a while to get used to the unusual style of the book but I soon began to appreciate the advantage of presenting material in this way. Since then I have purchased two other books from the series one of which was ‘Head First Design Patterns’

‘Head First Design Patterns’ describes the majority of the same design patterns presented in the Gamma et. al. book but in the same style as the rest of the Head First series. I thoroughly enjoyed reading this book and I think this is due to the conversational style in which the material is presented. Additionally, rather than just presenting a design pattern as a finished artifact, the design pattern discovery process is explored. This is achieved by initially posing a problem and a potential solution and subsequently evolving both until the design pattern is exposed. During the discovery process the authors discuss the pros and cons of design decisions and the forces acting on the design etc. essentially covering the same key information as the Gamma et. al. book.

Head First Design Patterns presents code samples in Java and I found this a very useful aid as it made the design pattern more tangible. Sample code helped with understanding the essence of the design pattern by presenting a specific implementation.

It is said that you don’t read about design patterns but explore them and I think this book helps you achieve this (or at least begin to). Unlike others on the subject it is one that can be read cover to cover. I recommend this book for someone just starting to explore design patterns and for those who already have a good grounding in design patterns.