Design Patterns: Elements of Reusable Object-Oriented Software

by: Erich Gamma (0)

Capturing a wealth of experience about the design of object-oriented software, four top-notch designers present a catalog of simple and succinct solutions to commonly occurring design problems. Previously undocumented, these 23 patterns allow designers to create more flexible, elegant, and ultimately reusable designs without having to rediscover the design solutions themselves.


The authors begin by describing what patterns are and how they can help you design object-oriented software. They then go on to systematically name, explain, evaluate, and catalog recurring designs in object-oriented systems. With Design Patterns as your guide, you will learn how these important patterns fit into the software development process, and how you can leverage them to solve your own design problems most efficiently.


Each pattern describes the circumstances in which it is applicable, when it can be applied in view of other design constraints, and the consequences and trade-offs of using the pattern within a larger design. All patterns are compiled from real systems and are based on real-world examples. Each pattern also includes code that demonstrates how it may be implemented in object-oriented programming languages like C++ or Smalltalk.

The Quotes

Creational patterns ensure that your system is written in terms of interfaces, not implementations.

Delegation is a good design choice only when it simplifies more than it complicates.

Program to an interface, not an implementation. Don’t declare variables to be instances of particular concrete classes. Instead, commit only to an interface defined by an abstract class.

The Reviews

Twenty Two years since the book's publication it remains incredibly relevant. In the beginning I was surprised the discussion in 1994 was this high level. The preface and introduction are awesome. For example, there was one discussion about dynamically typed languages versus statically typed lanugages... I was not even aware this was being discussed in 1994.In certain situations you see how this book changed the way the field of computer science developed. Before the writing of the book the authors originally called the Singleton pattern the Solitaire pattern. They changed it last minute (explained in the Conclusion) from Solitaire to Singleton, and that is a major part of why everybody calls it Singleton today.Some people may have an issue with the age of book. When you read the introduction, they mention that C++ and Smalltalk are cutting edge programming languages. I know C++ pretty well, but I have never used Smalltalk. What I learned from the book was how Smalltalk was fundamental to creating the MVC (Model-View-Controller) framework. In a lot of places the authors point out situations where C++ programmers would implement a pattern one way, and Smalltalk programmers might use the pattern another way.The book's examples are mostly about text writing programs, windowing, and drawing. These examples fit well for the patterns. You can also see how the current state of programming was much different. Text editors were creating huge innovations back then.This book requires sophistication as a programmer. It will be a challenging book for pretty much anyone to understand completely. You need to have familiarity with the word choice as well. The authors assume you are well versed in their language. The glossary was pretty good in this book, I would recommend taking a look before you start.The progression of the book is excellent. There is a lengthy introduction before getting to the patterns. This helps put the entire book in context and prepares you for the challenge to come. Each pattern is unique in subtle ways that the authors explain masterfully.One hundred years from now this book will still work. The patterns are fundamental to software design itself. I wish most authors were this bold.

I reference this book all the time. The way I organize my code improved tramendously after studying this book cover to cover!While the psuedo code seems to be more tailored to C++ and qualifiers like “friend”, the author(s) do make an effort at keeping the psuedo code generic, so the patterns may be easily applied to other OOP languages like Java, C#, Python, etc.I highly recommend this book along with Robert C. Martin’s “Clean Code” and Koopman’s “Better Embedded System Software” for any software engineer’s library!

The book is quite old and c++ code there is dated, nobody writes like that anymore. But the concepts and approaches are timeless. So many times I saw code that should be refactored according to the patterns presented in the book. The book really is a good source of inspiration on how and why the code should be written differently. Modern software libraries and products are inherently complex and good architecture is a must to make them reusable and scalable. Among the cons I would highlight the dated c++ code, but overall I think c++ is not the best language to present patterns. The book is rather dry on theory, hence the reader has to be prepared to consume dry technical material. Another quite sad disadvantage is that the book doesn't introduce a reader to GRASP patterns (General Responsibility Assignment Software Patterns), which is a list of guidances. GoF (GoF is gang of four and GoF patterns are the patterns presented in the book) patterns have much more sense if one thinks of them in terms of GRASP.As a good companion book, I would recommend "Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development" by Craig Larman. Larman's book gives a more gentle introduction to some of GoF patterns, explains why they are useful via GRASP guidelines and presents patterns via UML (and c# code if you like code more than diagrams) which is, in my view, much more accessible for developers who do not write code in c++. I agree that UML is outdated, but it gives a reader a good opportunity to grasp the ideas without constraints of a particular language. So two books work great together to introduce a reader to the world of good software engineering practices.btw I recently (summer 2019) had several interviews in big tech companies in silicon valley and in 2 of them I was told that this book is a very much recommended reading for every software engineer.

Front cover and inner front cover had large unremovable stickers on them saying "Property of Super Value." This could only be considered in fair condition according to the characteristics listed for books in good condition. The book also looks fairly heavily used being that it was apparently a training book in a corporate library used by seemingly a large number of people. I would think that a book in good condition would have been used by a single owner and gone through once with occasional reuse for reference... not used by many people in a corporate environment.

This was a good basis for patterns and the problems they solve. The examples are a bit outdated and may be hard to follow for new developers.

If you are interested in design patterns for object oriented programming languages this book will help you understand the concepts of design patterns. Note all the examples in this book are written in C++ so if you do not know little bit of c++ examples might be difficult to understand. I wish the examples were in python. But overall concept wise book is good.

What you've heard is true: this is the most important book on programming of the last __ years (at least 10, for me maybe of all time).I wanted to just put a few thoughts in that I didn't see in the other reviews:1. I read an article one time where John Vlissides (one of the authors) was saying he spoke somewhere and asked how many people had read the book and almost everyone raised their hands, then he asked, who would like to come up and explain how to implement the Composite pattern and suddenly only a couple hands were raised. Though this book is a fount of great ideas, it really will be most useful to you if you become CONVERSATIONAL with EACH of the patterns. That's the whole idea from Alexander anyway so consider it a mandate from on high.2. One easy way I've used to explain to people what patterns are about is that mere object oriented training leaves people with an idea of how to model things as objects, but so many times I've done reviews of programmers code and they got that far and then as soon as work needed to be done that required more than one class, one of two things happens: they start passing data all over the place (back to the structured world we go), or they start binding their objects into deadly embraces. This book teaches you how to have some 'tricks' in your bag for modeling just such situations. Now, that said, there is some work you will have to do to map it into the newer programming world we're living in, for instance distributed Java makes some services available (like EJBs/container services/messaging) that changes some of the implementation ideas considerably.3. If you are using Java, you can start to learn patterns and their application to your chosen platform by looking at a vast wealth of work that's already been done. The JDK uses the Observer pattern for its event model. Some of the more advanced frameworks, like BEA's Theory Center, are loaded w/Design Patterns (Chain of Responsibility and Strategy). And many products (Together/J) use patterns in their APIs (Visitor).Finally, whenever I'm interviewing programmers now I ask them if they know what patterns are, then if they get past that, if they can give me an example of a recent use of a pattern and how it worked. I had a guy a couple of weeks ago looking for 6 figures who told me he'd heard of the book but hadn't gotten around to opening it. Der, that's like a doctor saying 'I've heard milk might not be good for ulcers, but take it because I haven't had time to review the research yet.'More writers need to put out CD editions that are this good, dang it!!

Read it as a catalog, you’ll keep reading this book a lot of times if you really like to apply patterns into your programming.

When I received this book, I noticed it says "Indian adapted edition" and "Circulation of this edition outside of the Indian subcontinent is UNAUTHORIZED". I live in the US.The ad for this book just says "bilingual edition". The zoomed in picture doesn't look anything like the book I received, and the description doesn't mention anything about it. The book is all in English (I see no other languages) so I don't know what is different between this "Indian adapted edition" and a standard edition other than the price marked on the back is in an Indian currency. I am supposing the content is no different (why would it be?).It's just a little odd...

Book was in great condition.

This book characterizes the kind of thinking that moves you from the low-level 'small' view of a software developer to the high level long-term view of a software architect.While entry-level and junior developers may spent hours arguing fruitlessly over whether OOP is dead or alive, or whether functional programming is better or worse, most senior engineers and software architects understand that the concepts and ideas underlying these design patterns cannot and will not ever die because they apply to dealing with evolving software systems.The Observer pattern underlies almost every single reactive UI framework and most micro-service architectures, decorators have become mainstays in most languages, inversion of control (IoC) is crucial for dependency injection, and on and on... Anyone who says these patterns are dead is either profoundly confused or unaware of how prevalent they are underneath everything they do.Understanding the problems that these design patterns solve will help you design better software systems no matter what language or framework you use.Yes, the examples are in C++ and quite old, and I wish they updated this book to implement these patterns in a newer language like Go, Carbon, Kotlin, or C#... but even this slight deficiency doesn't justify taking a star away. Every other part of the book is complete gold. It should be updated, but even this version is well-worth the money.

My dog literally ate my old copy when he was a puppy so I purchased this copy on pure principle. If you work with software then NEED a great design patterns reference. I love this book and I've used it many times over the years. Suffice it to say, if you're a "real" Software Developer/Engineer you should have this book on your shelf. The book is broken down into three (3) categories (Creational, Structural, Behavioral) of patterns. Each category is further broken down into individual design patterns (sub-categories) with simple and explicit explanations on when and why to use the pattern, as well as HOW to implement the design pattern for your software. At the end of each categorical review of applicable design patterns the authors discuss the categorical patterns which is great for making the correlations necessary to conceptualize how and when to use the patterns discussed.

One of the best books for software engineers, must read

Fast shipping, great condition.

Concise. Readable. Authoritative.

Design Patterns: Elements of Reusable Object-Oriented Software
⭐ 4.7 💛 2147
kindle: $32.39
paperback: $35.90
hardcover: $34.95
Buy the Book