Bridge Design Pattern
The Bridge design motif
The informal description: Excerpts from [Gamma et al. 1995] (adapted for
Intent: Decouple an abstraction from its implementation so that the two can vary independently.
Structure: Original OMT diagram converted to UML (Why
- Abstraction: defines the abstraction's interface and maintains a reference to an object of type Implementor.
- RefinedAbstraction: Extends the interface defined by Abstraction.
- Implementor: defines the interface for implementation classes. This interface doesn't have to correspond exactly to Abstraction's interface; in fact the two interfaces can be quite different. Typically the Implementor interface provides only primitive operations, and Abstraction defines higher-level operations based on these primitives.
- ConcreteImplementor: implements the Implementor interface and defines its concrete implementation.
Collaborations: Abstraction forwards client requests to its Implementor object.