Holub on Patterns:

Learning Design Patterns by Looking at Code


This page is the support page for Allen Holub's book Holub on Patterns: Learning Design Patterns By Looking At Code. The page is rather sparse right now, but I'll be augmenting it over time. To find out about changes to this page, bug-fix releases, and so on, you should subscribe to the newsletter. Here are some book-related links within the holub.com site:
  1. Learn more about the book.
  2. Download the Static-Model and Design-Patterns Diagrams for the Game of Life (pdf/500 kb).
  3. Get the sources for the Game of Life.
  4. Get the sources for the SQL interpreter (HolubSQL).
  5. Get s a List of Listings, which references listing numbers and titles to page numbers.

If you find any bugs in the software, please report them to me.

-Allen

Take the Class

Allen offers a two-day design patterns class based on this book. This two-day seminar teaches you design patterns and object-oriented architecture by analyzing real-world code, not trivial examples. We'll look at the Game of Life and SQL interpreter in Allen's book as well as a server-side UI framework (that's not in the book). This approach shows you how patterns actually appear in the real world, so gives you a real-world understanding that you can't get from the more typical catalog-of-patterns approach. You'll come out of this seminar understanding good OO architecture and knowing, not only what the patterns are, but how to apply them effectively.

Find more information at /training/oo.patterns.html.

Links

The Hillside Design Patterns Home Page contains a wealth of information on design patterns (and vast numbers of links to other pattern-related sites).

Pattern Books and Articles

There are lots of other books on Patterns that nicely complement my book. Here's a list of good ones:

Applying Patterns

  1. Eric Gamma, JUnit, A Cook's Tour. This is an online article, not a book. It's a guided tour of the architecture of JUnit—Eric Gamma's unit-test platform. Gamma shows you how the design is built incrementally using a patterns approach. A great case study.
  2. Joshua Kerievsky Refactoring to Patterns. This book shows you how to correct common problems in badly done computer programs by systematically applying design patterns to the code. It identifies "Code Smells"---architectural defects---and takes you step by step through the process of correcting those defects using a design-patterns approach. I like the practical approach that the author takes.
  3. Buschmann, et al. Pattern-Oriented Software Architecture: A System of Patterns. This book introduces a few patterns new patterns, but more importantly, covers how patterns work together to form an overall architecture. In particular, they describe the "Presentation/Abstraction/Control" UI architecture, which is a vast improvement of Model/View/Controller.

Catalogs

  1. Gamma, Helm, Johnson, & Vlissides, Design Patterns: Elements of Reusable Object-Oriented Software. The "Gang-of-Four Book." This is the book that started it all. It's a catalog of the patterns that I demonstrate in my book.
  2. John Vlissides, Pattern Hatching, Design Patterns Applied. A good complement to the Gang-of-Four book, covers material that probably should have been in the original book.
  3. Partha Kuchana Software Architecture Design Patterns in Java. This book is a Gang-of-Four style catalog of the Gang-of-Four design patterns. It's much more readable than the original, however, and the examples are in Java.
  4. Schmidt, et al. Pattern-Oriented Software Architecture vol. 2: Patterns for Concurrent and Networked Objects. A follow on to the Buschmann book mentioned above. Presents patterns for multithreading and concurrent applications.
  5. Coplein & Schmidt Ed., Pattern Languages of Program Design 1. The four PLOP books (this one and the next three in the list) catalog bunches of patterns not covered by the Gang of Four.
  6. Vlissides, Coplein, & Kerth Ed., Pattern Languages of Program Design 2.
  7. Martin, Riehle, & Buschmann, Pattern Languages of Program Design 3.
  8. Harrison, Foote, & Rohnert Ed. Pattern Languages of Program Design 4.
  9. Martin Fowler, et al. Patterns of Enterprise Application Architecture. Patterns associated with generic Enterprise applications, including database-related (Object-Relational) patterns and web patterns.
  10. Alur, Crupi, & Malks, Core J2EE Patterns: Best Practices and Design Strategies. Patterns associated with Java's "Enterprise Edition," particularly EJB architecture. To my mind, EJB is a failed technology. It's poorly conceived, poorly executed, and is a classic example of why design by committee fails to produce standards that are useful in the real world. This book's real value is in showing how a patterns approach can make a fundamentally flawed architecture usable.

UML Books

Martin Fowler's UML Distilled: A Brief Guide to the Standard Object Modeling Language (3d Ed.) Is a good introduction to UML.

My own UML Quick Reference is a good reference (if I do say so myself).

Craig Larman's Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and the Unified Process (2nd Ed.) is really a book about the entire OO-Design process. It shows you how UML is actually applied when building a real design. The book's only fault is that it's a little weak on the requirements-gathering side, but other books cover that subject.

Double-Checked Locking

I mention in the book that you shouldn't use the "double-checked locking" pattern to implement Singleton in a multithreaded scenario. Here are a few articles that explain why:

  1. Allen Holub, Warning! Threading in a Multiprocessor World.
  2. Brian Goetz, Double-checked locking: Clever, but broken.
  3. Bacon et al, The "Double-Checked Locking is Broken" Declaration