- 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.
-
Notifications
You must be signed in to change notification settings - Fork 0
State Design Pattern Tutorial in Python
License
shubhamwagh/State-Design-Pattern-Tutorial
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
State Design Pattern Tutorial in Python
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published