Home Page -------------------
[Home Page] - [Reviews Main]
-------------------

Book Review
Design Patterns - Elements of Reusable Object-Oriented Software by Gamma & Helm & Johnson & Vlissides
Recommended
ISBN: 0-201-63361-2       Publisher: Addison-Wesley       Pages: 400pp       Price: £28.95
Categories:   patterns    
Reviewed by Sean Corfield in Overload OL9 (Aug 1995)

Patterns

Patterns are probably the hottest topic in OO at the moment and this, the "Gang of four" pattern catalogue, the most widely praised. So what's all the fuss about?

At its core, this book has a catalogue of twenty-three "design patterns". The patterns are design-level templates for creating solutions to common problems. And that's it, really.

"That's it?" you say. Well, yes and no. What makes this book so special is simply that no-one has taken the trouble to distil this problem commonality, categorise it and write it up in a form that programmers and designers can actually understand.

A roadmap

The book is in three sections (despite the claim of "two main parts" in the preface). The first section attempts to explain what patterns are and how you use them. The third section looks at where we are now and where we might be going. The catalogue of patterns makes up the central, and largest, section of the book (270 pages).

It is probably worth quoting a line from the Preface: "A word of warning and encouragement: Don't worry if don't understand this book completely on the first reading. We didn't understand it all on the first writing!". My first reaction was one of disappointment because the pattern descriptions were just that: descriptions. They didn't seem generic enough and the code fragments given were often for specific examples. So I put the book down for a couple of weeks and then started reading it again.

Hard work

This book makes you work! Hard! On subsequent readings I began to appreciate this more and more because I began to see two things: patterns that I had unknowingly already applied and patterns that I could have applied. The former gives you insights that help you solve other, similar problems more quickly. The latter tends to make you curse, because if you had applied the pattern, the end result would have been more elegant and more flexible!

Whilst the amount of applied thinking that the book requires is unusually high compared to the norm these days, the authors have provided plenty of hints and tips on how to best use the material in the book. They provide several suggestions for ways to read the book as well as how to use it to solve particular problems. The latter section (§1.6) is particularly helpful as it takes you through various parts of the design process, pointing out how various patterns fit in to different scenarios that you might be trying to solve.

Organisation

For a catalogue, the book is extremely readable because the authors have adopted a clear and consistent method for documenting the patterns. Each pattern is explained by stating what it is intended to do, why you might want to do that and when you can. The components and interactions behind each pattern are then explained with a mixture of prose, OMT, Booch and examples, before moving on to the "how". Finally, example code is given in C++ or Smalltalk (or both) and some real world uses are mentioned.

This means you can quickly establish whether the pattern is useful or interesting, and as you read further you get more detail and more hints on how to apply it to your own problem.

Dipping in

I've found that the most instructive way to read the book is just to open it up randomly, flick back to the start of whatever pattern you're in and just start reading. You probably won't put it down until you've read several patterns. Over time, you'll absorb more and more of them - some are more intuitive than others. One thing that struck me was the variety of application domains from which the authors have drawn their examples: FACADE (compiler), CHAIN OF RESPONSIBILITY (help system), STATE (TCP communication), VISITOR (inventory / pricing). Of course, the usual graphics and text editor examples are also present.

Code fragments

Don't expect pages of C++ template-based source code - you'll be disappointed like I initially was. The code used to illustrate the patterns is mainly C++ with some Smalltalk but this is a book about design rather than about programming. If you want the generic pattern in code, you'll have to think hard and understand the pattern so that you can apply it to your own code or derive the template-based solution if one exists (it doesn't always).

Conclusion

You probably don't need me to tell you, but this is a very rewarding book. Buy it and dip into it a few times and you'll find yourself coming back to it time and time again. The reward comes from the "lightbulb effect" as patterns start to suggest themselves when you're designing systems later on.
Other Authors with the same surname

Gamma
Design Patterns CD by Erich Gamma  (Reviewed Sep 1998)
Design Patterns, Elements of Reusable OO Software by Gamma & Helm & Johnson & Vlissides [Highly Recommended]  (Reviewed Sep 1995)

Helm
Design Patterns, Elements of Reusable OO Software by Gamma & Helm & Johnson & Vlissides [Highly Recommended]  (Reviewed Sep 1995)

Johnson
AutoCAD, the Complete Reference (Second Edition) by Nelson Johnson  (Reviewed Mar 1992)
Building Application Frameworks by Mohamed Fayad & Ralph Johnson & Douglas Schmidt [Recommended]  (Reviewed Jul 2000)
Database Models, Languages, Design by James Johnson [Highly Recommended]  (Reviewed Jul 1998)
Design Patterns, Elements of Reusable OO Software by Gamma & Helm & Johnson & Vlissides [Highly Recommended]  (Reviewed Sep 1995)
Domain-Specific Application Frameworks by Mohamed Fayad & Ralph Johnson  (Reviewed Jul 2000)
Electronic Publishing Construction Kit by Scott Johnson  (Reviewed Mar 1997)
LABVIEW Graphical Programming by Gary Johnson [Recommended]  (Reviewed Nov 1996)
Troubleshooting and Configuring the Windows NT/95 Registry by C Johnson  (Reviewed Nov 1997)
Turbo C++ By Example by Johnson & Perry  (Reviewed Jan 1994)
Turbo C++ by Example by M Johnson & Greg Perry  (Reviewed May 1993)

Vlissides
Design Patterns, Elements of Reusable OO Software by Gamma & Helm & Johnson & Vlissides [Highly Recommended]  (Reviewed Sep 1995)
Pattern Languages of Program Design 2 by Vlissides [Recommended]  (Reviewed Nov 1996)


Last Update - 13 May 2001.

To link to this review, please use the URL: http://www.accu.org/bookreviews/public/reviews/d/d002004.htm

Copyright © The Association of C & C++ Users 1998-2000. All rights reserved.

Mirrored from http://www.accu.org/