Login :
Password :

Design patterns

Bridge development

Static diagram :

Static diagram

Strong points :

  1. 1. Extensibility
    1. OK 1.1 Addition or removal of a concrete implementor does not need code modification
    2. KO 1.2 Addition or removal of a refined abstraction does not need code modification
  2. 2. Decoupling between abstraction and implementor
    1. OK 2.1 Minimal number of concrete implementor
    2. KO 2.2 Maximal factorization of the link between abstraction and implementor

Spoiled pattern instantiations on different problems

Problem 1 :

Problem wording :
Design a system enabling to display on a screen some empty windows (no button, no menu...). A window can have several different styles depending on the platform used. We consider two platforms, XWindow and PresentationManager. The client code must be written independently and without knowledge of the future execution platform. It is probable that the system evolves in order to display specialized windows by “application windows” (able to manage applications) and “iconised windows” (with an icon).
Optimal solution :

Static diagram :

Static diagram

In this solution, there is a real separation between the windows style and their content. It is possible to add a new style or a new type without modifying existing code.

Alternative solution :

Static diagram :

Static diagram

This solution has no extensibility and a lot of ConcreteImplementor

Les têtes de mule
Cédric BOUHOURS
Cédric BOUHOURS
Cédric BOUHOURS