Skip to content

Latest commit

 

History

History
15 lines (8 loc) · 596 Bytes

File metadata and controls

15 lines (8 loc) · 596 Bytes

State

State pattern allows an object to alter its behavior when its internal state changes. This pattern is close to the concept of finite-state machines. The state pattern can be interpreted as a strategy pattern, which is able to switch a strategy through invocations of methods defined in the pattern's interface.

PlantUML model

plantuml code

Source code examples: music player state, machine on off state