Skip to content

Latest commit

 

History

History

state

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

State

Using this pattern lets you separate functionalities depending on the current state of the object. Each State will be separate object that has a method and each method will act according to its state.

It is single responsibility since objects we're separated according to its state

Open/Closed Principle since you can add more state without breaking existing code.

You will be saved from conditionals