Patterns and Contextual Design

In the CAD/CAM problem earlier in this book, I showed how design patterns can be used by focusing on their context with each other. Design patterns working together can assist in the development of an application's architecture. It is also useful to distinguish how many of the patterns are microcosmic examples of design by context.

For example,

  • The Bridge pattern tells me to define my Implementations within the context of the derivations of my Abstraction.

  • The Decorator pattern has me design my Decorators within the context of my original component.

  • The Abstract Factory has me define my families within the context of my overall problem so I can see which particular objects need to be implemented.

In fact, designing to interfaces and polymorphism in general is a kind of design by context. Look at Figure 21-1, which is a reprint of Figure 8-4. Notice how the abstract class' interface defines the context within which all of its derived classes must be implemented.

Figure 21-1. The relationships between commonality/variability analysis, perspectives, and abstract classes.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.212.212