From Pattern Repository Wiki
Revision as of 14:09, 9 June 2009 by Scott Bain (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Strategy 1.jpg
The Strategy Pattern encapsulates a single varying algorithm. The consumer of the algorithm does not couple to any particular implementation of the Strategy type, nor to the fact that the type is abstract, nor to the fact that there is a variation in place.

Bridge 1.jpg
The Bridge Pattern encapsulates three variations; the variation of the entity object ("abstraction" in GoF parlance), the variation in the behavior object ("implementation" per GoF), and the different way each entity uses the behavioral abstract type.


Because the two "sides" of the Bridge Pattern are related, this carries the risk that a new implementation of the entity variation may require the interface of the behavioral variation to change, usually by getting larger. This may also require existing implementations of the behavioral variation to change, as they will have to support the new method in the interface they implement.

The Strategy Pattern carries no such risk.