Replace Template With Strategy | |||
| |||
Context: Eliminate Duplication By Inheritance essentialy leaves the code with a Template based structure that allows variation by subclassing thus coupling the varying concept with the class hierarchy. Replace Template With Strategy decouples the variation from the class hierarchy by capturing the varying concept with an interface. Replace Template With Strategy is a key refactoring in Evolving to the Strategy Pattern See also : Access Subclass Features By Interface and Break Inheritance |