# One Concern Per File

> A design rule that each file plays exactly one declared role, and a file that plays two is split.

Record: `architecture:one-concern-per-file`
Kind: principle
Layer: [Structural Core](https://banes-lab.com/records/layer/structural-core.md)
Severity: mandatory
Scope: file
Canonical: https://banes-lab.com/ontology#architecture-one-concern-per-file

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Sideways Overflow](https://banes-lab.com/records/architecture/sideways-overflow.md) and before [Narrowest Concern](https://banes-lab.com/records/architecture/narrowest-concern.md).

## Repair

- Refactored by: Split by Responsibility
- Detected by: a file that classifies equally well under two declared concerns
- Violated by: forcing a two-role file under an arbitrary tag instead of splitting it
- Measured by: split-candidate count
- Enforced by: classification review

## Requires

- [Classification Judgment](https://banes-lab.com/records/lexicon/classification-judgment.md)

## Reinforces

- [Separation of Concerns](https://banes-lab.com/records/architecture/separation-of-concerns.md)

## Enables

- [Narrowest Concern](https://banes-lab.com/records/architecture/narrowest-concern.md)

## Conflicts with

- [Multi-Role File](https://banes-lab.com/records/lexicon/multi-role-file.md)
- [Sentence-Shaped Name](https://banes-lab.com/records/lexicon/sentence-shaped-name.md)

## Severity

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

## Category

- [Taxonomy / Classification / Naming](https://banes-lab.com/records/architecture-category/taxonomy-classification-naming.md)

## Required by

- [Collision Consolidation](https://banes-lab.com/records/architecture/collision-consolidation.md)

## Linked from

- [Placement is a grammar](https://banes-lab.com/disciplined-methodology/build/placement-is-a-grammar.md)
- [The layer spine](https://banes-lab.com/software-architecture/model/the-layer-spine.md)
- [Core Modular Design](https://banes-lab.com/ontology/principles/architecture-category-core-modular-design.md)
- [Taxonomy / Classification / Naming](https://banes-lab.com/ontology/principles/architecture-category-taxonomy-classification-naming.md)
- [Taxonomy / Classification / Naming](https://banes-lab.com/ontology/lexicon/lexicon-category-taxonomy-classification-naming.md)
- [Severity levels](https://banes-lab.com/ontology/schema/the-vocabulary-severity.md)
