Template Method

Get an overview of the template design pattern.

Let’s take a top-down approach to understand this design pattern.

Definition

A template method is a behavioral design pattern. It’s used to create a method in the parent class and defer some of the implementation steps to the subclasses.

Explanation

According to the definition above, we would have a parent class containing the template method. In this method, we would have two types of operations:

  • Operation(s) that are the same for all of its child classes.
  • Operation(s) that are different for
...