View RSS Feed

WingedPanther

Book Review: Design Patterns

Rate this Entry
by , 10-14-2009 at 04:40 AM (898 Views)
The full title of the book is Design Patterns: Elements of Reusable Object-Oriented Software, by Erich Gamma, Richard Helm,Ralph Johnson, and John Vlissides. Before I start, I'll warn you that the copyright on this book is from 1995. As a result, the ideas in this book should not be news to you.

Unfortunately, they were. This is the book that answered the one question I've always answered my biggest question: "What's so darned special about OOP that means it makes software reusable and other programming methods don't?" This book sheds light on the answer to that question. It goes through five design patterns related to the creation of objects, seven patterns for how to make different classes work together, and eleven patterns for how classes can function. These patterns include terms I had heard (Factory, Iterator, Views) and others I had seen in action (Chain of Responsibility, Command, Observer, Bridge, Composite, Facade, Singleton).

There are 6 chapters in the book. The first two provide general motivation and an overview of what is covered. The next three go through each pattern in detail, along with intro and final comparison of patterns. As you go through a pattern, you will get a practical example of the kinds of problems it solves, UML diagrams of the solution, UML diagrams of the general pattern, strengths and weaknesses, how patterns relate to each other, and actual code! Source code is in C++ (pre-standard but with templates) and SmallTalk. The last chapter is a summary and looks forward to the future.

First note: the book is very well written, easy to read, and very relevant today. It talks about the MVC approach to software in SmallTalk as an example of design patterns. The same approach that is hitting .NET circles today. It talks about how to dispatch events, mechanisms that match behavior in Delphi, wxWidgets, gtkmm, and many other languages/GUI libraries.

Second note: the book is feeling its age. Not in the design patterns, which are solid and relevant, but in the examples. I've been using computers since around 1988, and had never heard of most of the examples used in this book. However, I don't need to know the specific drawing programs they cite to know how a drawing program works. I don't need to know how this or that text editor worked, because the modern text editors do the same thing. The simple RegEx parser they built was quite familiar, however.

Third note: the ideas in this book are not feeling their age. What amazes me is that there aren't more books like it on the shelves. Not only does it discuss how to design your software well, so that it will be robust and extensible, but it also talks about how language features impact implementation of these patterns. Often, a language feature will be the deciding factor. It talks about differences in how inheritence is implemented, how typing works, etc, and how those "minor differences" can make one design pattern or another much easier or harder to implement.

This book is the opposite of a book on algorithms and data types. An algorithms book looks at the lowest level detail of things like lists, queues, and stacks. This book looks at the highest level decisions, like how to glue two different libraries together that weren't designed to work together or how to keep two different classes synchronized, or how to add a feature dynamically.

I strongly recommend the book, despite the uncomfortably high price tag.

Submit "Book Review: Design Patterns" to Digg Submit "Book Review: Design Patterns" to del.icio.us Submit "Book Review: Design Patterns" to StumbleUpon Submit "Book Review: Design Patterns" to Google

Tags: None Add / Edit Tags
Categories
Uncategorized

Comments

  1. Jordan's Avatar
    Sounds like an excellent read. It can be purchased used on Amazon.com for $22. Design patterns are fascinating to learn and read about.
  2. WingedPanther's Avatar
    I paid the "on the shelf full price" and B&N. Still worth the money
  3. marwex89's Avatar
    I have this one in pdf format somewhere, seems like I must read it!