Purpose:
Decouple an abstraction from its implementation so that the two can vary independently.
To
think about this situation that an abstract class has two categories of
inheritance. Each category can be a seperate hierarchical
inheritance tree, if we derive all the subclasses from the
abstract class, it will make complex when we need to get some
sub-classes that contains facades from two categories. So we need
seperate those subclasses into differenct categories, typically one
into implementation hierarchy while another into abstraction hierarchy
which can employ subclasses of implementation hierarchy. No matter
how, the relationship between different hierarchies is a bridge. From
this point, the bridge pattern design lets different hierarchies can
evolve seperately.
The structure of the Adapter Pattern (object
adapter) may look similar to the Bridge Pattern. However, the adapter
is meant to change the interface of an existing object and is mainly
intended to make unrelated classes work together.
reference:
book:
"Design Patterns” Gamma et al.http://en.wikipedia.org/wiki/Bridge_pattern
http://www.c-sharpcorner.com/Language/BridgePatternsinCSRVS.asp
http://www.codeproject.com/gen/design/bridge.asp