23.07.2012 Views

Design Patterns Explained

Design Patterns Explained

Design Patterns Explained

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 21 • <strong>Design</strong> <strong>Patterns</strong> Reviewed 3O9<br />

lem domain into the main set of responsibilities I always use (the<br />

ConcreteComponent) and the variations I optionally have— my<br />

decorators. Strategies decompose my problem into an object that<br />

uses rules and the rules themselves.<br />

Relationships Within a Pattern<br />

I must admit, in my courses, I have some fun with a certain quote<br />

from Alexander. After I have been talking about how great patterns<br />

are for two-thirds of a day, I pick up Alexander's Timeless Way of<br />

Building, turn to the end, and say<br />

This book is 549 pages long. On page 545, which, I think<br />

you will agree, is pretty close to the end, Alexander says,<br />

"At this final stage, the patterns are no longer impor tant: ... " 1<br />

I pause to say, "I wish he'd have told me this at the beginning and I<br />

could have saved myself some time!" Then I continue to quote from<br />

him: "The patterns have taught you to be receptive to what is real. " 2<br />

I finish with, "If you read Alexander's book, you will know what is<br />

real— the relationships and forces described by the patterns."<br />

The patterns give us a way to talk about these. However, it is not<br />

the patterns themselves that are important. This is true for software<br />

patterns as well.<br />

<strong>Patterns</strong> aren 't<br />

really the important<br />

thing<br />

A pattern describes the forces, motivations, and relationships about Software patterns<br />

a particular problem in a particular context and provides us with an are multidimen-<br />

approach to addressing these issues. The Bridge pattern, for exam- sional descriptions<br />

pie, is about the relationship between the derived classes of an<br />

1. Alexander, C., Ishikawa, S., Silverstein, M., The Timeless Way of Building, New<br />

York: Oxford University Press, 1979, p. 545.<br />

2. ibid, p, 545.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!