# Template Method Pattern

> A design pattern that fixes the steps of an algorithm in a base class and lets subclasses supply the steps that vary.

Record: `architecture:template-method-pattern`
Kind: pattern
Layer: [Design Patterns Core](https://banes-lab.com/records/layer/design-patterns-core.md)
Severity: contextual
Scope: workflow, framework
Canonical: https://banes-lab.com/ontology#architecture-template-method-pattern

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Strategy Pattern](https://banes-lab.com/records/architecture/strategy-pattern.md) and before [Observer Pattern](https://banes-lab.com/records/architecture/observer-pattern.md).

## Repair

- Refactored by: Introduce Template Method
- Detected by: duplicated method sequences
- Violated by: copied workflows with small variations
- Measured by: workflow duplication
- Enforced by: [design review](https://banes-lab.com/records/architecture/design-review.md)

## Requires

- [Stable Algorithm Skeleton](https://banes-lab.com/records/lexicon/stable-algorithm-skeleton.md)

## Reinforces

- [Framework Reuse](https://banes-lab.com/records/lexicon/framework-reuse.md)

## Enables

- [Controlled Variation](https://banes-lab.com/records/lexicon/controlled-variation.md)

## Conflicts with

- [Duplicated Workflow](https://banes-lab.com/records/lexicon/duplicated-workflow.md)

## In tension with

- [Inheritance Coupling](https://banes-lab.com/records/lexicon/inheritance-coupling.md)

## Tensions

- [Template Method Pattern / Inheritance Coupling](https://banes-lab.com/records/tension/inheritance-coupling-template-method-pattern.md)

## Severity

- [contextual](https://banes-lab.com/records/vocabulary/severity-contextual.md)

## Category

- [Behavioral Patterns](https://banes-lab.com/records/architecture-category/behavioral-patterns.md)

## Linked from

- [Integrating algorithms](https://banes-lab.com/pag/patterns/algorithm-integration.md)
- [Behavioral Patterns](https://banes-lab.com/ontology/lexicon/lexicon-category-behavioral-patterns.md)
- [Severity levels](https://banes-lab.com/ontology/schema/the-vocabulary-severity.md)
- [The resolutions](https://banes-lab.com/ontology/schema/the-resolutions.md)
