Template Method
- Describe
how Template Method pattern supports separation of an algorithm into an
invariant core using varying behavior in subclasses.
- Describe
how Template Method can be used to reduce code duplication by promoting
commonality to upper classes in a class hierarchy.
- Explain the use of Template Method to support "hooks" that allow extended behavior at well defined places.
- Both Strategy and Template Method define algorithms. Contrast the differences between the two patterns.
- Explain how the Template Method pattern could use the Strategy pattern to define the algorithm's steps rather than inheritance.