TEMPLATE METHOD Pattern
Solution
- Define a superclass that has a method for the algorithm and
abstract methods for the primitive operations.
- Implement the algorithm to call the primitive operations in the
appropriate order.
- Do not define the primitive operations in the superclass, or
define them to have appropriate default behavior.
- Each subclass defines the primitive operations but not the
algorithm.