
We earn a commission if you buy through these links. Learn more
Design Patterns
by Erich Gamma, John Vlissides
Guide by the Books of the Day editors · Updated · How we write our guides
The catalog that gave object-oriented programmers a shared language for recurring design problems, still useful for its principles even where the examples have aged.
What Creators Say About Design Patterns
1 creator reviewed Design Patterns on YouTube in 2015, with 3K views between them. Their opinions are their own; we picked these reviews, we didn't write them.
What It's About
Design Patterns is the catalog that gave object-oriented developers a shared vocabulary. Its four authors describe 23 recurring solutions to design problems that show up again and again in object-oriented software, from ways to create objects without hard-wiring their classes to ways to let one object notify many others about a change. Each pattern is presented in a consistent template covering its intent, when to use it, its structure, participants, consequences, and an example of where it appears in real systems.
The style is dense and reference-like rather than narrative. You will not get a story or a single argument carried through chapters; you get a substantial opening section on design principles and a worked example, then the catalog itself, which you will mostly read in pieces and return to. The examples are in C++ and Smalltalk, and some of the code looks dated, but the reasoning is what matters. Reading it feels like working alongside experienced designers who keep asking why a solution is shaped the way it is and what it costs.
Two more notes. The authors are four, not two: Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides, widely called the Gang of Four. And the book is not a method for designing software. It gives you a vocabulary and a set of tested trade-offs, which you still have to apply with judgment.
Read this if you…
- already write object-oriented code and want your class designs to be easier to change
- are preparing for design reviews or technical discussions and want a common vocabulary
- want to understand why many frameworks and libraries are shaped the way they are
Skip it if you…
- are new to programming or object-oriented design and need a gentler, example-driven introduction
- want a modern guide to a specific language, since the examples predate many current language features
Key Ideas
- 1
Program to an interface, not an implementation
Depend on abstract types rather than concrete classes so that the parts of your system that use an object do not care how it is built. This keeps code easier to change, test, and extend. Many of the patterns in the catalog are different ways of applying this single habit to a specific situation.
- 2
Favor object composition over class inheritance
Inheritance fixes behavior at compile time and can tangle classes together in fragile hierarchies. Composition builds behavior by combining smaller objects, which can often be swapped at run time. The book uses this idea to explain why several of its patterns exist and why they are often preferable to deep class trees.
- 3
Patterns as named, reusable trade-offs
Each pattern records a problem, the forces pulling against each other, a solution, and the consequences of choosing it. The real value is that a team can say the name of a pattern and share the whole bundle of reasoning at once. The book is as much about recognizing trade-offs as it is about the code.
- 4
Creational, structural, and behavioral pattern families
The 23 patterns are grouped by purpose: how objects get created, how they are assembled into larger structures, and how they communicate and share responsibility. This grouping gives you a map for finding a relevant pattern when you know the kind of problem you have but not its name.
Limitations
The examples are written in C++ and Smalltalk, and much of the code predates modern language features such as lambdas and built-in iterators, which now handle some patterns for you. Critics also argue that the catalog encouraged some developers to reach for patterns where simpler code would do. The book is demanding to read straight through, and it offers a starting vocabulary rather than a complete method. Treat it as a reference and a source of principles rather than a playbook.
Questions Readers Ask
- Do I need to know C++ or Smalltalk to get value from it?
- No. The patterns are about structure and trade-offs, and the code is there to illustrate them. You do need comfort with classes, interfaces, and inheritance in some language. Readers who mainly know Python, Java, or C# can translate the examples without much trouble, and the explanations carry most of the meaning.
- Is it still relevant, or should I read something newer?
- The core principles and most of the patterns still appear in frameworks and codebases today, so the book remains worth reading. For a fuller picture, pair it with more recent material on refactoring and software design that shows how modern language features change which patterns you actually need.
- Published
- 1995
- ISBN
- 9780133052664
- Difficulty
- intermediate
- Category
- Tech
Book details and cover from Google Books.
Ready to read Design Patterns?
Get your copy on Amazon, or listen to it on Audible. We earn a commission if you buy through these links.