Skip to content

Latest commit

 

History

History
 
 

state

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

State

The pattern allows an object to alter its behavior when its internal state changes. The object will appear to change its class. It has behavioral purpose and applies to the objects.

When to use

  • when an object's behavior depends on its state, and it must change its behavior at run-time depending on that state
  • operations have large, multipart conditional statements that depend on the object's state