Skip to content

shubhamwagh/State-Design-Pattern-Tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

State Design Pattern Tutorial

  • State Design Pattern allows an object to change its behavior when its internal state changes.
  • It is a behavioral type design pattern.
  • It has State Interface which represents all behaviors (methods) the context will exhibit.
  • The Concrete States in the state design pattern are the implementations of the State Interface that define behaviors specific to each state.
  • It has Context Class that holds a reference to the current state and expose methods to clients.
  • Useful to manage states in the applications and swtich between them.
  • Easy to maintian since each state is a different class and state-specific behavior is encapsulated in its respective class.
  • New states can be easily added by writing an extra class for the new state.
  • E.g. States in a document, states in a game, or different modes in a GUI.

About

State Design Pattern Tutorial in Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages