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 12 • Solving the CAD/CAM Problem with <strong>Patterns</strong> 211<br />

Figure 12-1O After applying the Bridge and Facade patterns.<br />

Applying the Facade pattern means that I insert a facade between<br />

the V1 modules and the VlImp object that is going to use them.<br />

v1Facade has simplified methods that relate to what Vlimp needs<br />

to do. Each method in ViFacade will look like a series of function<br />

calls on the V1 system.<br />

The kind of information that I need in order to call these functions<br />

will determine how v1Imp is implemented. For example, when<br />

using V1, I need to tell it which model to use and what the Feature's<br />

ID is. All Vlimp objects that use the ViFacade will therefore need to<br />

know this information. Since this is implementation-specific<br />

information, it will need to know it itself, rather than getting it from<br />

the calling Feature. Thus, in a V1 system, each Feature will need<br />

its own Vlimp object (to remember system-specific information<br />

about the feature). I will go over this in more detail once the general<br />

architecture is completed.<br />

The Facade

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

Saved successfully!

Ooh no, something went wrong!