[Head First Design Patterns] Template Method Pattern
22 Apr 2022Template Method Pattern
-
The Template Method
defines the steps of an algorithm and allows subclasses to provide the implementation for one or more steps. -
Just a simple pattern: 1) it is a method 2) serves a template for an algorithm
-
Can define
hook
function in algorithm to allow subclass or subclass’s instance modify algorimth if any.