# State Pattern

> The State design pattern — encapsulate state-dependent behavior in distinct state objects so transitions replace conditional branching.

Record: `algorithms:state-pattern`
Kind: algorithm
Canonical: https://banes-lab.com/ontology/algorithms#algorithms-state-pattern
Closure: https://banes-lab.com/json/records/algorithms/state-pattern/closure

Listed in [Algorithm contracts](https://banes-lab.com/api/records/algorithms.md), after [Design Patterns Core](https://banes-lab.com/records/algorithms/design-patterns-core.md) and before [Separation of Concerns](https://banes-lab.com/records/algorithms/separation-of-concerns.md).

## Domain

- [Architectural Clusters](https://banes-lab.com/records/algorithms-domain/architectural-clusters.md)

## Tier

- [exempt](https://banes-lab.com/records/vocabulary/domain-tier-exempt.md)

## Principle

- [State Pattern](https://banes-lab.com/records/architecture/state-pattern.md)

## Composed by

- [Finite State Machine](https://banes-lab.com/records/algorithms/finite-state-machine.md)

## Linked from

- [Behavioral Patterns](https://banes-lab.com/ontology/principles/architecture-category-behavioral-patterns.md)
- [Architecture](https://banes-lab.com/ontology/algorithms/algorithms-domain-architecture.md)
- [Domain tiers](https://banes-lab.com/ontology/schema/the-vocabulary-domain-tier.md)
