<<< Bridge     Index     Composite >>>

30. Bridge Sample

  • Consider the abstraction of shapes.

  • The interface named DrawingAPI could be implemented by concrete classes, DrawingAPI1 or DrawingAPI2.

  • The client instantiates drawing primitives CircleShape:

      Bridge patern UML Hierarchy diagram

  • The Bridge design pattern bridges two hierarchies via CircleShape collaboration:

      Bridge patern UML Collaboration diagram

  • Instances of CircleShape will forward drawing requests to either DrawingAPI1 or DrawingAPI2.

<<< Bridge     Index     Composite >>>