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.

228 Part V • Handling Variations with <strong>Design</strong> <strong>Patterns</strong><br />

When a new requirement is introduced to the problem, I will look at<br />

the different alternatives I could use, such as:<br />

• Using switches in the code<br />

• Specialization with inheritance<br />

• Encapsulating what varies and containing it or using a refer<br />

ence to it<br />

By looking at these alternatives, I show that there are similarities<br />

among many of the patterns: often, different patterns will approach<br />

handling variation and new requirements in a similar fashion.

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

Saved successfully!

Ooh no, something went wrong!