# Message Chain

> A defect in which a client navigates a chain of objects to reach the behavior it needs.

Record: `architecture:message-chain`
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-message-chain

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Inappropriate Intimacy](https://banes-lab.com/records/architecture/inappropriate-intimacy.md) and before [Middle Man](https://banes-lab.com/records/architecture/middle-man.md).

## Repair

- Refactored by: hide_delegate, introduce_facade_method, move_behavior_to_owner
- Detected by: a.getB().getC().doX, deep_property_access, repeated_navigation_paths
- Violated by: Require clients to traverse a chain of objects to reach behavior or data, exposing internal object graph structure.
- Measured by: member-access chain depth at call sites
- Enforced by: a lint rule on member-access chain depth

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

- [Low Coupling](https://banes-lab.com/records/architecture/low-coupling.md)

## Linked from

- [Above one tier, reduction](https://banes-lab.com/software-architecture/scale/above-one-tier-reduction.md)
- [Anti-patterns](https://banes-lab.com/ontology/principles/architecture-category-anti-patterns.md)
- [Core Modular Design](https://banes-lab.com/ontology/principles/architecture-category-core-modular-design.md)
- [Core Modular Design](https://banes-lab.com/ontology/lexicon/lexicon-category-core-modular-design.md)
- [Severity levels](https://banes-lab.com/ontology/schema/the-vocabulary-severity.md)
- [The forces](https://banes-lab.com/ontology/schema/the-forces.md)
