# Temporal Coupling

> A defect in which operations must be called in an undocumented order to work.

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

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Zombie Code](https://banes-lab.com/records/architecture/zombie-code.md) and before [Hidden Side Effect](https://banes-lab.com/records/architecture/hidden-side-effect.md).

## Repair

- Refactored by: encode_state_machine, constructor_valid_state, make_order_explicit, add_precondition
- Detected by: must_call_initialize_first, method_fails_before_setup, order_dependent_tests, state_machine_hidden_in_calls
- Violated by: Require operations to be called in a specific undocumented order for correctness.
- Measured by: operations that fail when called out of order
- Enforced by: types or constructors that only produce valid states, precondition checks

## 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

- [Causality ordering](https://banes-lab.com/records/force/causality-ordering.md)
- [Contract compatibility](https://banes-lab.com/records/force/contract-compatibility.md)
- [Correctness verification](https://banes-lab.com/records/force/correctness-verification.md)
- [Modularity](https://banes-lab.com/records/force/modularity.md)

## Negated by

- [Statelessness](https://banes-lab.com/records/architecture/statelessness.md)

## Linked from

- [Orchestration as declared structure](https://banes-lab.com/pag/orchestration/declared-structure.md)
- [An anti-pattern is a decay path](https://banes-lab.com/software-architecture/decay/an-anti-pattern-is-a-decay-path.md)
- [Anti-patterns](https://banes-lab.com/ontology/principles/architecture-category-anti-patterns.md)
- [Scalability / Performance / Optimization](https://banes-lab.com/ontology/principles/architecture-category-scalability-performance-optimization.md)
- [Scalability / Performance / Optimization](https://banes-lab.com/ontology/lexicon/lexicon-category-scalability-performance-optimization.md)
- [Severity levels](https://banes-lab.com/ontology/schema/the-vocabulary-severity.md)
- [The forces](https://banes-lab.com/ontology/schema/the-forces.md)
