# Chain of Responsibility Pattern

Record: `arch:chain-of-responsibility-pattern`
Kind: pattern
Layer: [Design Patterns Core](https://banes-lab.com/records/layer/design-patterns-core.md)
Severity: recommended
Scope: behavior, request handling, pipeline
Canonical: https://banes-lab.com/ontology#arch-chain-of-responsibility-pattern

## Repair

- Refactored by: Extract Handler Chain
- Detected by: long if/else ladders handling heterogeneous requests
- Violated by: one handler with nested conditionals for every case
- Measured by: handler cyclomatic complexity
- Enforced by: [design review](https://banes-lab.com/records/arch/design-review.md)

## requires

- [Uniform Handler Interface](https://banes-lab.com/records/lex/uniform-handler-interface.md)

## reinforces

- [Open/Closed Principle (OCP)](https://banes-lab.com/records/arch/open-closed.md)
- [Single Responsibility Principle (SRP)](https://banes-lab.com/records/arch/single-responsibility.md)

## enables

- [Pluggable Handling](https://banes-lab.com/records/lex/pluggable-handling.md)
- [Ordered Fallthrough](https://banes-lab.com/records/lex/ordered-fallthrough.md)

## conflicts-with

- [Monolithic Handler](https://banes-lab.com/records/lex/monolithic-handler.md)

## tensions-with

- [Traceability](https://banes-lab.com/records/arch/traceability.md)

## tensions

- [Chain of Responsibility Pattern Traceability](https://banes-lab.com/records/tension/chain-of-responsibility-pattern-traceability.md)
