Object Model

[Previous] [Next]

The Adapter design pattern is a fairly straightforward concept to grasp. However, as you can see by reading through the scenarios, you can choose from alternative designs depending on whether your intention is to adapt a class, an object, or a function, and on whether you want the adapter to be transparent or opaque. (The benefits and drawbacks of these types of adapters will be explored further in the "Ramifications" section of this chapter.) With so many types of adapters, I think it's only fair to illustrate object models for a variety of possibilities. Figure 4-3 below, and Figures 4-4 and 4-5 on the following page, model class, object, and function adapters, respectively. Figures 4-3 and 4-4 are transparent adapters, while Figure 4-5 is an opaque adapter.

click to view at full size.

Figure 4-3. Transparent Class Adapter.

click to view at full size.

Figure 4-4. Transparent Object Adapter (with events).

click to view at full size.

Figure 4-5. Opaque Function Adapter.



Microsoft Visual Basic Design Patterns
Microsoft Visual Basic Design Patterns (Microsoft Professional Series)
ISBN: B00006L567
EAN: N/A
Year: 2000
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net