Polski

Behavioral patterns

Template Method

A base class fixes the skeleton of an algorithm and subclasses fill in selected steps.

Article

Template Method: a fixed recipe, interchangeable ingredients

The Template Method pattern through importing supplier price lists: the base class fixes the order of steps, and subclasses provide parsing and optional hooks. The Hollywood principle, an inheritance-free variant in Go and code in five languages.

Related articles

Around the topic

In this group: Behavioral patterns