Template Method Pattern
  • is a behavioral design pattern that defines the skeleton of an algorithm in the superclass but lets subclasses override specific steps of the algorithm without changing its structure

Solution

two types of steps:

  • abstract steps must be implemented by every subclass
  • optional steps already have some default implementation, but still can be overridden if needed

Code Structure

Comparisons

Resources