Design Patterns · Junior · Question 22 of 75

What is the Template Method pattern?

Explanation

For example, a base class DataExporter defines export(): load → transform → save, and subclasses implement transform() for CSV and JSON. In a functional style, the same is done by passing step functions.

Further reading

Problem with a question

Design Patterns · Junior · question 22

Test yourself

Take the Design Patterns · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz