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 2O • The Analysis Matrix 3O1<br />

For example, if in our e-tail system I included requirements on<br />

printing sales tickets and found the following variations:<br />

• U.S. sales tickets need headers<br />

• Canadian sales tickets need headers and footers<br />

• German sales tickets need two different footers<br />

I would include this information in its own row, each entry relating<br />

to the format of sales tickets. I would implement this row's requirements<br />

with a Decorator pattern.<br />

Although the Analysis Matrix rarely captures all aspects of a particular<br />

problem domain, I have found it useful for at least part of most<br />

problem domains. I find it most useful when I am given so many<br />

special cases that I can't get my head around the big picture.<br />

It is usually worse than this. Rarely are different cases of requirements<br />

stated to analysts or developers in any coordinated fashion.<br />

This does not significantly complicate the Analysis Matrix process,<br />

however. In these situations, I take a feature and look in the leftmost<br />

column and see what concept it is a variant of. If I find the<br />

concept, I put the feature in that row. Not being able to find such a<br />

concept indicates I must create a new row.<br />

In extreme situations, the Analysis Matrix may be the only way to<br />

get a handle on things. I once had a client that literally had dozens of<br />

special cases. Each case was a separately developed document<br />

control system. The problem was to integrate all of these document<br />

control systems together. So many special cases were present (there<br />

were also dozens of rows) that it was impossible to think about the<br />

entire problem all at once. The analysts did not have a good conceptual<br />

grasp of what was involved. They just talked about general<br />

rules and exception cases. By considering each case individually, I<br />

was able to abstract out the common data and behavior (which<br />

Applicability of the<br />

Analysis Matrix<br />

More useful as<br />

problems get bigger

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

Saved successfully!

Ooh no, something went wrong!