Skip to content

Latest commit

 

History

History
19 lines (11 loc) · 658 Bytes

File metadata and controls

19 lines (11 loc) · 658 Bytes

Template Method Pattern

Definition

The Template Method Pattern defines the skeleton of an algorithm in a method, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure.

Design principle

The Hollywood Principle - Don't call us, we'll call you.

Connection beetween Template Method and Factory Method pattern.

The Factory Method is a specialization of Template Method

Class diagram schema for Template Method pattern

Alt text

Class diagram of Template Method example

Alt text