State (cont’d)
Consequences
- easy to add new states
- makes state transitions and instance variables associated with a state explicit
- increased number of classes
Implementation
- who defines the state transitions
- creating and destroying state objects
- using dynamic inheritance if applicable