State
Usage
- Also known as: Objects for States
- Alters an object's behavior when its state changes
- The object will appear to change its class
Diagram
Participants
Context
State
- Defines the interface of interest to clients
- Maintains an instance of a ConcreteState subclass that defines the current state
ConcreteState
- Defines an interface for encapsulating the behavior associated with a particular state of the Context
- Each subclass implements a behavior associated with a state of Context
Resources URL:
notes/design_patterns/resources
Sources URL:
notes/design_patterns/sources
