mirror of
https://github.com/JakubVojvoda/design-patterns-cpp.git
synced 2025-12-17 21:04:36 +03:00
add State pattern
This commit is contained in:
10
state/README.md
Normal file
10
state/README.md
Normal file
@@ -0,0 +1,10 @@
|
||||
## 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
|
||||
Reference in New Issue
Block a user