# Template Method: Same Routine, Your Own Step

When three label classes copy the same four steps and differ only in the barcode, a fix to the shared steps has to be made three times, and one copy is always missed; writing the routine once in a base class and letting each carrier's subclass fill in its own barcode is the Template Method pattern.

![Cheat sheet: Template Method: Same Routine, Your Own Step](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/2aac5c2c92094c52820848ed8165f632.webp)

- Category: Data Structures
- Level: Journeyman
- Tags: Abstract Method, Code Smell, OOP, Template Method Pattern
- Author: Gregor Dzierzon
- Updated: November 17, 2026

Source: https://www.ask-codey.com/cheat-sheets/dp-template-method-cheat-sheet
