The Patterns Movement

Design principles and metrics are merely ways to measure the quality of a given design. They don't really tell us how to create good designs. In fact, creating a design from scratch is difficult. How should we begin? Where should we begin? How can we guard against needing to redesign? How will we answer critics who ask why we chose one design and not another? What we really need are reusable designs.

Surprisingly, reusable designs exist. The idea comes from architecture, where a group of architects and city planners calling themselves New Urbanists are asking why armies of professionally trained architects and engineers equipped with modern methods and technology produce strip malls, tract homes, parking lots, and golden arches?  What happened to the charming main streets, parks, cafes, churches, hotels, gardens, and homes built by our untrained, ill-equipped predecessors?

To be sure, much of the answer involves economics and politics, but in his book The Timeless Way of Building [ALX] Christopher Alexander argues that we have lost our sense of design. Having delegated the job to experts, methodologies, and regulations, we have forgotten how to build.

How do we regain this sense? Unfortunately, good design can't be explicitly defined. It is too deeply rooted in human experience to be isolated in a neat phrase. It is part of our background "knowledge," and as such, it can't be completely pulled into the foreground. (See [WIN] for more detail on this idea.) Words like living, organic, authentic, and self sustaining are close synonyms, but they fall short. In the end, Alexander calls it the quality without a name. Calling designs "patterns", he writes:

A "living" pattern reconciles all of its internal forces; it is self-sustaining, while a "dead" pattern is not. A living pattern inspires life in neighboring patterns, while a dead pattern infects and kills its neighbors. 

This resonates somewhat with programming, too. A good design is almost instantly recognized by an experienced programmer. It sparks a feeling of delight and satisfaction that transcends our goals and principles. This is not to say that good design is subjective or unrecognizable. Recognizing good design is like recognizing good wine. While not everyone can taste the difference between sour grape juice and a complex cabernet at first, we can train ourselves to become connoisseurs. In the case of wine, this is a matter of tasting lots of examples of good wine, learning to distinguish subtle features, and learning to communicate with other wine experts. Alexander proposes a similar idea for architects: pattern catalogs.

A design pattern is a recurring design problem together with a generic, reusable solution. A pattern catalog collects, classifies, and names design patterns mined from well designed structures. The patterns in a catalog usually follow Alexander's problem-solution format:

Traditional Neighborhood Development [KUN][1]

Other Names

TND, New Urbanism, Neo-traditional Planning, Low-density Urbanism, Transit Oriented Development (TOD), civic art.

Problem

Post World War II zoning laws and property taxation policies, the rise of nation-wide chain stores, and increased reliance on automobiles has led to suburban sprawl, urban decay, and the death of traditional neighborhoods and downtown districts. These problems contribute to social and environmental problems such as crime, racism, poverty, pollution, and alienation.

Solution

1. Neighborhoods should be the basic unit of city planning. Networks of neighborhoods connected and bounded by corridors (rivers, parks, boulevards) form towns and cities.

2. A neighborhood has a well defined boundary, which is no more than a five minute walk from a focused center. Neighborhoods are mixed-use and mixed-income.

3. The primary function of the street is to define a public space. Buildings must be disciplined to honor and embellish this public space. Cars are not given precedence over people.

etc.

Design Patterns for Software

While the impact of pattern catalogs on architecture remains to be seen, they have had a big impact on object oriented software engineering. Inspired by Alexander's ideas, small groups of programmers have been assiduously mining and cataloging software design patterns. Several well known catalogs exist ([Go4], [POSA]), there are pattern groups (Hillside, Siemens), pattern conferences (PloP and EuroPloP), pattern web sites ([WWW 8], [WWW 9]), there is even a catalog of anti patterns [ANTI]. Pattern catalogs are now an important weapon in a programmer's arsenal of tricks and tools.

A design pattern can be viewed as a recipe for solving a recurring design problem. In this analogy a pattern catalog can be viewed as a cookbook containing design patterns organized according to the types of problems they solve.

A design pattern describes a group of classes or packages that work together to solve the problem. We call such a grouping a collaboration. Thus, a design pattern describes a recurring collaboration used to solve a recurring problem.

The Pattern Movement

The idea of using pattern catalogs to describe best practices has mushroomed into the Pattern Movement. Many industries have developed pattern catalogs. There are pattern catalogs for each phase of software development.



[1] Catalog pattern entries are typically several pages long. I will not present entries in full detail. Instead, I will give an abbreviated form with references directing the reader to catalogs where the entry appears.