Template Method Pattern
Summary
- The Template Method pattern enables algorithms to defer certain steps to subclasses.
Class diagram: (see Template Method Pattern code review)
Usage
Use the Template Method pattern when:
- Common behaviour can be factored out of an algorithm.
- The behaviour varies according to the type of a subclass.