Author’s purpose
The purpose of the authors is to provide a catalog of the most important design patterns in a format that developers can use:
“The purpose of this book is to record experience in designing object-oriented software as design patterns. Each design pattern systematically names, explains, and evaluates an important and recurring design in object-oriented systems. Our goal is to capture design experience in a format that people can use effectively. To this end, we have documented some of the most important design patterns and present them as a catalog.” (p.21/540)
In other words, the idea is to provide blueprints on how to build software in an object-oriented way. Using patterns helps us as developers
to not reinvent the wheel every time we design a solution, instead, it helps us build upon the experience of many other developers that came before us.
It also provides us with a common language in our field. Complex software components become easy to understand when we recognize that it is following a specific pattern.
Now, the complex component can still be complex, but the essence is known and understood because it follows a pattern.
Plus, using battle-tested patterns helps us improve the reusability and maintainability of our code.
Main themes of the book
The book is divided into two parts. The first one corresponds to an introduction to design patterns in object-oriented software. This includes a case study in which the authors ‘architect’ a Document Editor, and apply several of the design patterns of the book.
For me, this part is interesting because the authors provide some requirements for the Document Editor, and then they show how those requirements could be fulfilled with the design patterns.
In addition, this part of the book is so interesting, that while you are reading it, ideas begin to emerge in your head on how to apply these same patterns to your projects and how, without knowing,
you have applied those patterns before.
The second part is the catalog of the design patterns itself. The patterns are divided into three types: creational, structural, and behavioral. In total, there are 23 patterns.
This part is also very interesting and it is the essence of the book. Reading this section from beginning to end gives you a valuable education in object-oriented design.
I believe that once you know the patterns, you will try to apply them everywhere, or at least, try to find them everywhere in the code you read.
The only issue with this part of the book is that given that it is a relatively old book (1994), the examples are written mainly for C++ and the examples cited are from software written 30 years ago.
This means that following the authors could be a little more complicated than it should be if you’re not very familiar with C++.
Uniqueness of the book
The book is unique because it is the first book that documents design patterns in software. Previous exercises were done in other disciplines like building architecture or urban planning, but not in software.
This book is also unique because it is very well-researched, it is based on the PhD dissertation of one of the authors (Erich Gamma).
For example, when the authors describe a pattern, they point out in which projects/software it is present and with proper referencing.
This means that the authors do invent patterns out of thin air, but the patterns that they have compiled were present in the software of renowned companies at the time.
Was the author successful in his objective?
Yes, the authors were successful. They presented a complete catalog, and with it they have influenced the software engineering profession.
The patterns that they have described are now part of the software engineering language, and they have become common knowledge.
For example, to help me understand and apply the patterns, I reached for different sources on how to apply each design in the current language that I am programming in.
Searching the internet on how to apply any of these patterns in a specific language throws hundreds of results!
Comparison against the best book in the field
Given their notoriety and success, this book probably is among the best books in the software engineering field.
One of the most renowned authors in software engineering Bob Martin, states in the Clean Coder:
“Here is a minimal list of the things that every software professional should be conversant with:
- Design patterns. You ought to be able to describe the 24 patterns in the GOF book …” (Martin, Clean Code Collection)
Conclusion
I would recommend this book to all software engineers who which to go deep in their skills.
It is indeed a helpful book that I will consult regularly when programming. Plus, it is a reference so, I know that to fully digest its contents I need to apply the design patterns to my code.
However, for some developers who are just interested in the gist of the design patterns, probably there are better resources on the web. Of course, those resources are based eventually on this book.
As I mentioned above, I looked for the implementations of each pattern in my current language. No need to reinvent the wheel in that regard either.