# Action at a Distance

> A defect in which one part of the system changes behavior elsewhere through globals, patches or implicit listeners.

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

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Hidden Side Effect](https://banes-lab.com/records/architecture/hidden-side-effect.md) and before [Ambient Context](https://banes-lab.com/records/architecture/ambient-context.md).

## Repair

- Refactored by: explicit_dependency, localize_effect, trace_causation, restrict_global_mutation
- Detected by: monkey_patch, global_registry_mutation, ambient_context_write, implicit_subscriber_side_effect
- Violated by: Let one part of the system change behavior far away through globals, monkey patches, shared registries, ambient context, or implicit event listeners.
- Measured by: global mutations and implicit listener registrations
- Enforced by: lint rules against global mutation and monkey patching

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

- [Event messaging](https://banes-lab.com/records/force/event-messaging.md)

## Negated by

- [Controlled Side Effects](https://banes-lab.com/records/architecture/controlled-side-effects.md)

## Linked from

- [Seven controls, seven classes](https://banes-lab.com/software-architecture/decay/seven-controls-seven-classes.md)
- [Anti-patterns](https://banes-lab.com/ontology/principles/architecture-category-anti-patterns.md)
- [Transactions / State / Concurrency](https://banes-lab.com/ontology/principles/architecture-category-transactions-state-concurrency.md)
- [Severity levels](https://banes-lab.com/ontology/schema/the-vocabulary-severity.md)
- [The forces](https://banes-lab.com/ontology/schema/the-forces.md)
