When to use Template Method pattern?

When to use Template Method pattern?

Ninja Asked on 18th September 2018 in Design Pattern.
Add Comment
1 Answer(s)
Best answer

The Template Method pattern is used when

  1. You want to avoid code duplication by reusing an algorithm
  2. The behavior of an algorithm can vary, you let subclasses implement the behavior through overriding
Ninja Answered on 18th September 2018.
Add Comment