O'Reilly logo

Pattern Oriented Software Architecture Volume 5: On Patterns and Pattern Languages by Douglas C. Schmidt, Kevlin Henney, Frank Buschmann

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

5 Pattern Complements

Nothing is more dangerous than an idea,when you have but one idea.

Émile-Auguste Chartier

A complement is something that makes another thing complete in some way. In this chapter we look at how this notion can apply to patterns. First, we see how two or more patterns can enrich a design process by offering contrast and competition between alternative solutions to similar problems. Next, we look at how one pattern can complete the design of another. Last, we see how these two views of complements—process and structure, competitive and cooperative—are not necessarily so very different, by illustrating how competing patterns can cooperate and be combined.

5.1 More than One Solution to a Problem

There is a common perception among many developers that certain types of problems are resolved by only a single pattern [BuHe03] [Bus03a]. This perception is sometimes reinforced in the naming of particular patterns. For example, collection iteration problems can be addressed by ITERATOR, object adaptation problems are addressed by ADAPTER, stateful object lifecycle problems are addressed by OBJECTS FOR STATES, and so on, as we also discussed in Section 0.2, A Story of Success… with Some Exceptions.

The idea that one problem maps to one solution acts as a security blanket for some pattern users, since it seems to make life simpler. In particular, the lack of choice and variation is seen as a strength rather than a weakness, since it eliminates design choice and with ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required