Bridge Pattern
The Bridge Pattern is used to separate the interface from its implementation so that both can vary independently.
The normal inheritance of classes from an interface suffers from the following two limitations:
- Extension could lead to an exponential number of subclasses.
- Both the abstraction interface and its implementation are closely tied together
Unlike normal class B implements interface A and A has no idea of B; in Bridge pattern abstractions have a link to implementations.
Notes:
- The instance of Implementation (impl) can either be in "Abstraction" interface or in its subclasses.
- Subclasses of "Abstraction" can either be interface or concrete classes.
- The two hierarchies are designed separately.
When a client object invokes a method on the Abstraction object, it forwards the call to the Implementer object it contains. The Abstraction object may offer some amount of processing
before forwarding the call to the Implementer object.
As an example look at the following which is a bit different from the above diagram:
page_revision: 8, last_edited: 1213762693|%e %b %Y, %H:%M %Z (%O ago)







