Skip to content

Template method#

The intent of the template method pattern is to define a skeleton of an algorithm in the superclass but lets subclasses override specific steps of the algorithm without changing its structure.

Structure#

AbstractClass

+algorithm()

+step1()

+step2()

ConcreteClass1

+step1()

+step2()

ConcreteClass2

+step1()

+step2()

ConcreteClass3

+step2()

Back to top