When to use Template Method pattern?
Answered
When to use Template Method pattern?
Best answer
The Template Method pattern is used when
- You want to avoid code duplication by reusing an algorithm
- The behavior of an algorithm can vary, you let subclasses implement the behavior through overriding