mirror of
https://github.com/JakubVojvoda/design-patterns-cpp.git
synced 2025-12-17 21:04:36 +03:00
10 lines
420 B
Markdown
10 lines
420 B
Markdown
## 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 |