# Premature Abstraction

> A defect in which a shared abstraction is extracted before its variation is understood, so it fits no caller well.

Record: `architecture:premature-abstraction`
Kind: anti-pattern
Layer: [Enforcement Core](https://banes-lab.com/records/layer/enforcement-core.md)
Severity: discouraged
Scope: modularity
Canonical: https://banes-lab.com/ontology#architecture-premature-abstraction

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Speculative Generality](https://banes-lab.com/records/architecture/speculative-generality.md) and before [Over-Abstraction](https://banes-lab.com/records/architecture/over-abstraction.md).

## Repair

- Refactored by: duplicate_until_pattern_stabilizes, split_abstraction, extract_later_from_evidence
- Detected by: many_flags_in_shared_abstraction, subclasses_override_most_behavior, callers_work_around_abstraction
- Violated by: Extract a shared abstraction before variation is understood, causing the abstraction to fit no use case well.
- Measured by: flags and overrides per shared abstraction
- Enforced by: design review against evidence of recurrence

## Contracts

- [Pattern Distiller Kernel](https://banes-lab.com/records/algorithms/pattern-distiller-kernel.md)

## Severity

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

## Category

- [Anti-patterns](https://banes-lab.com/records/architecture-category/anti-patterns.md)

## Force

- [Modularity](https://banes-lab.com/records/force/modularity.md)

## Negated by

- [Evolutionary Architecture](https://banes-lab.com/records/architecture/evolutionary-architecture.md)

## Linked from

- [Core templates](https://banes-lab.com/pag/templates/templates-core.md)
- [The structural domain](https://banes-lab.com/software-architecture/principles/the-structural-domain.md)
- [Anti-patterns](https://banes-lab.com/ontology/principles/architecture-category-anti-patterns.md)
- [Architecture Review / Evolution / Governance Artifacts](https://banes-lab.com/ontology/principles/architecture-category-architecture-review-evolution-governance-artifacts.md)
- [Pattern distillation](https://banes-lab.com/ontology/algorithms/algorithms-domain-pattern-distillation.md)
- [Severity levels](https://banes-lab.com/ontology/schema/the-vocabulary-severity.md)
- [The forces](https://banes-lab.com/ontology/schema/the-forces.md)
