52

I am interested in learning design patterns and would like to know what are considered top tier books in learning this subject.

Is there a book out there that's the de-facto standard for describing best practices, design methodologies, and other helpful information on design patterns? What about that book makes it special?

5
  • I'm not sure if this is what you're thinking about, but I find lots of clever development stuff on Forrst. Commented Sep 9, 2010 at 22:11
  • 2
    How about a title of "Reference sources for design patterns" or "Design pattern resources" (since I don't mean "reference" as just "look up on demand") and move all the list stuff into the body (or remove it)?
    – Roger Pate
    Commented Sep 25, 2010 at 13:05
  • .NET Design Pattern and Architectural Guidance
    – Giorgi
    Commented Sep 25, 2010 at 19:41
  • For some decent implementations, I used to take a look at the ones on dofactory (didn't buy the books though). Commented Sep 25, 2010 at 22:28
  • 4
    Given this question received a complete and comprehensive answer, I've closed the other design patterns questions as duplicates of this one to designate it as the canonical Q&A and answer pair for this topic.
    – user8
    Commented Dec 9, 2011 at 22:37

11 Answers 11

61

Design Patterns: Elements of Reusable Object-Oriented Software comes very close to my definition of a canonical book on design patterns. According to its wikipedia article (emphasis mine):

The original publication date of the book was October 21, 1994 with a 1995 copyright, and as of July 2010, the book was in its 38th printing. The book was first made available to the public at OOPSLA meeting held in Portland, Oregon, in October 1994. It has been highly influential to the field of software engineering and is regarded as an important source for object-oriented design theory and practice. More than 500,000 copies have been sold in English and in 13 other languages.

Ward Cunningham, a design patterns pioneer, maintains an online catalog of the book's patterns on WikiWikiWeb. And according to the Wikipedia article on design pattern (again, emphasis mine):

Design patterns gained popularity in computer science after the book Design Patterns: Elements of Reusable Object-Oriented Software was published in 1994 by the so-called "Gang of Four" (Gamma et al.).

There are quite a few other books referenced in the same article as notable in the genre:

Of those I've read Fowler's book, it's highly influential and a good read. At certain points it's a little vague for my taste, but overall it's an enjoyable book. There's an online catalog of the patterns included in the book, with minimal descriptions.

I've also skimmed through Head First Design Patterns, and if you have read any other book of the Head First series, it's of the same high quality and as enjoyable as most books in the series:

Head First is a series of introductory instructional books to many topics, published by O'Reilly Media. It stresses an unorthodox, visually intensive, reader-involving combination of puzzles, jokes, nonstandard design and layout, and an engaging, conversational style to immerse the reader in a given topic.

The term "design pattern" is somewhat vague, as every general reusable solution can be considered a design pattern. I've always noticed a tendency to apply the label on the solutions described in one of the notable books I've listed above, and more specifically the Gang of Four and Fowler books. Design patterns do not follow a unique development process, they are normal software solutions that happen to be immensely reusable and they are extremely hard to identify.

But if you compare the online catalogs for both books with the contents of language specific books you'll notice that they are often used as templates. So I'd say that both books are very close to being canonical references, with the GoF book being the more important one from a historical perspective, even though both books are limited to object oriented programming.

4
  • 2
    +1. Actually i wanted to give you +5 but alas that's not allowed. Commented Dec 9, 2011 at 3:46
  • The entire Pattern-Oriented Software Architecture series is about patterns in different types of systems - Volume 1 is about architectural patterns and patterns that cross-cut domains, Volume 2 is about concurrent systems, Volume 3 is about resource management in networked/distributed systems, Volume 4 is about distributed systems, and Volume 5 is about pattern languages as well as a reference for the other 4 volumes. Given the question, I think that Volume 5 might also be applicable, but I haven't spent too much time with it...yet.
    – Thomas Owens
    Commented Dec 12, 2011 at 15:47
  • @Yannis this one and head first generally is based on static typed languages. Are there any good books for dynamic languages like python.
    – ravi404
    Commented May 4, 2013 at 15:09
  • @ravi404 norvig.com/design-patterns
    – whytheq
    Commented Feb 3, 2019 at 13:38
29

The Gang of Four book - Design Patterns: Elements of Reusable Object-Oriented Software is probably the closest thing we have to an industry standard on design patterns.

For a more accessible introduction, Head First: Design Patterns is good too. Don't be put off by the 'trendy' cover, as it's a good read and will probably help you grasp the concepts in the GoF book a lot easier if you read it first.

24

Head First Design Patterns

At any given moment, somewhere in the world someone struggles with the same software design problems you have. You know you don't want to reinvent the wheel (or worse, a flat tire), so you look to Design Patterns--the lessons learned by those who've faced the same problems. With Design Patterns, you get to take advantage of the best practices and experience of others, so that you can spend your time on...something else. Something more challenging. Something more complex. Something more fun.

You want to learn about the patterns that matter--why to use them, when to use them, how to use them (and when NOT to use them). But you don't just want to see how patterns look in a book, you want to know how they look "in the wild". In their native environment. In other words, in real world applications. You also want to learn how patterns are used in the Java API, and how to exploit Java's built-in pattern support in your own code.

You want to learn the real OO design principles and why everything your boss told you about inheritance might be wrong (and what to do instead). You want to learn how those principles will help the next time you're up a creek without a design pattern.

Most importantly, you want to learn the "secret language" of Design Patterns so that you can hold your own with your co-worker (and impress cocktail party guests) when he casually mentions his stunningly clever use of Command, Facade, Proxy, and Factory in between sips of a martini. You'll easily counter with your deep understanding of why Singleton isn't as simple as it sounds, how the Factory is so often misunderstood, or on the real relationship between Decorator, Facade and Adapter.

With Head First Design Patterns, you'll avoid the embarrassment of thinking Decorator is something from the "Trading Spaces" show...

4
  • This. It's a very accessible read, and changed the way I approach software engineering completely.
    – GSto
    Commented Sep 13, 2010 at 14:07
  • 2
    the entire head first series are great, especially for starting devs. Commented Sep 25, 2010 at 20:27
  • 3
    I love the book, but absolutely hate the cover! A non-programmer colleague of mine walked by my office the other day, saw the book and said "Head First Designer Patterns? Are you going into the fashion business?"
    – Pete
    Commented Oct 15, 2010 at 21:01
  • 2
    @Pete Why the cover can get you into more trouble. She apparently lives a double life. fishbowl.pastiche.org/2005/08/12/…
    – Gordon
    Commented Oct 16, 2010 at 11:31
10

Yes, there is a well known book about design patterns: Design Patterns: Elements of Reusable Object-Oriented Software and the authors are often called "the Gang of Four" (GoF) and is referenced in almost all texts about design patterns.

3
  • Also Martin Fowler's book: amazon.com/Patterns-Enterprise-Application-Architecture-Martin/… Commented Dec 8, 2011 at 23:03
  • This is not a book about design patterns. It's a catalog of patterns. There's a short introduction to design patterns in the beginning, but I don't think that introduction is sufficient. Commented Dec 9, 2011 at 3:44
  • @JörgWMittag There's isn't a unique process of creating design patterns, design patterns are relatively small reusable solutions. Design patterns are created through the normal processes of software development, what distinguishes them is their immense re-usability. The only relevant unique process is identifying a solution as a design pattern, and catalogues do that finely.
    – yannis
    Commented Dec 25, 2011 at 14:18
9

Design patterns : elements of reusable object-oriented software

alt text

From wikipedia:

Design Patterns: Elements of Reusable Object-Oriented Software is a software engineering book describing recurring solutions to common problems in software design. The book's authors are Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides with a foreword by Grady Booch. The authors are often referred to as the Gang of Four, GoF, or Go4. The book is divided into two parts, with the first two chapters exploring the capabilities and pitfalls of object-oriented programming, and the remaining chapters describing 23 classic software design patterns. The book includes examples in C++ and Smalltalk.

0
2

I think that the Refactoring to Patterns can be useful simply because it describes how certain desing / code can be refactored towards patterns in the GoF book. This may help to overcome the initial learning curve. Oh and it also contemplates on 'Pattern-happiness' :)

You may also find the first three volumes of Pattern-Oriented Software Architecture to be a good read.

2

One of the best design pattern websites around is Ward's Wiki, the very first wiki. See http://c2.com/cgi/wiki?HistoryOfPatterns for a good starting page in it.

In 1987, Ward and Kent were consulting with Tektronix's Semiconductor Test Systems Group that was having troubles finishing a design. They decided to try out the pattern stuff they'd been studying. Like Alexander who said the occupiers of a building should design it, Ward and Kent let representatives of the users (a trainer and a field engineer) finish the design.

Ward came up with a five pattern "language" that helped the novice designers take advantage of Smalltalk's strengths and avoid its weaknesses...

Ward and Kent were amazed at the (admittedly spartan) elegance of the interface their users designed. They reported the results of this experiment at OOPSLA 87 in Orlando. They wrote up a panel position, and presented at Norm Kerth's workshop on Where do objects come from? They talked patterns until they were blue in the face, and got a lot of agreement, but without more concrete patterns nobody was signing up.

Meanwhile, Erich Gamma was busy writing and reflecting about object-oriented design in ET++ as part of his PhD thesis. Erich had realized that recurring design structures or patterns were important. The question really was how do you capture and communicate them.

Bruce Anderson gave a talk at TOOLS 90 at which ErichGamma was present; Erich liked the talk. Bruce gave a paper at EcoopOopsla90 (Ottawa) and ran a BOF called Toward an Architecture Handbook where he, Erich Gamma, Richard Helm, and others got into discussions about patterns. That was the first time that Richard and Erich met, and they realized they shared common ideas about the key ideas behind writing reusable OO software.

Just prior to ECOOP'91 Erich Gamma and Richard Helm, sitting on a rooftop in Zurich on a sweltering summer's day, put together the very humble beginnings of the catalog of patterns that would eventually become DesignPatterns...

Things really got rolling at the OOPSLA workshop that Bruce ran in 1991. Coincidentally, Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides were all there; they would later become the Gang of Four that authored the Design Patterns book...

0
1

Design Patterns

This tutorial site contains following sub-sections

  • Intent of each design pattern
  • Real World Structure for the design pattern
  • A Problem statement
  • Detailed discussion on the problem
  • Checklist on how to arrive at a pattern
  • Rules of thumb while arriving at pattern.
  • Code snippets for the design pattern which includes C#, C++, Delphi, Java and PHP

This site also contains guide on Anti Patterns, UML and Refactoring.

1
  • The SourceMaking site looks simplistic at first glance, but it's really a great reference. Aside from the design patterns, some of the development, architecture & project management antipatterns are hilarious. The refactored solutions can actually help you save a meeting that's going off the rails. (Not bad for a design pattern reference)
    – Whatever
    Commented Oct 25, 2010 at 18:34
1

The original book, "Design Patterns: Elements of Reusable Object Oriented Software" is a good resource for object oriented design patterns.

There exist many other books out there. When I need a quick reference and my GoF book is out of reach, Wikipedia normally has enough information on those and other design patterns.

Those are the primary ones I use. It should also be noted that people have started applying the pattern format to other things, such as project management.

If you want to know about antipatterns, which you should be aware of, there's two books, "AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis" as well as "Refactoring: Improving the Design of Existing Code" which has a section on code smells, another name for antipatterns.

1

"Agile Principles, Patterns, and Practices in C#" by Robert C. Martin. I think he has a Java version of the book as well.

Also, not a pattern itself, but Domain Driven Design has some great concepts even if you don't go for the full DDD approach.

  * Ubiquitous Language
  * Code first approach (vs. DB first)
  * etc.
1

If you are interested specifically in design patterns in C++ try Modern C++ Design by Andrei Alexandrescu.

This book talks about how to implement commonly used patterns like Factory, Singleton, and Visitor in C++. It also talk about very C++-specific topics such as smart pointers, template metaprogramming, and policy-based class design.

Book author is an authoritative expert, known for his

pioneering work on policy-based design implemented via template metaprogramming. These ideas are articulated in his book Modern C++ Design and were first implemented in his programming library, Loki. He also implemented the "move constructors" concept in his MOJO library. He contributed to the C/C++ Users Journal under the byline "Generic<Programming>"...

4
  • 1
    would you mind explaining more on what it does and what it's good for? "Link-only answers" are not quite welcome at Stack Exchange
    – gnat
    Commented Apr 30, 2013 at 7:25
  • @gnat: how's this?
    – Dima
    Commented Apr 30, 2013 at 13:03
  • well your recent edit certainly looks an improvement to me. Though readers of the answer would probably benefit from a more detailed explanation of who is Aleksandresku
    – gnat
    Commented Apr 30, 2013 at 14:57
  • @gnat: since you obviously know who he is, please feel free to edit my answer.
    – Dima
    Commented Apr 30, 2013 at 17:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.