add State pattern

This commit is contained in:
Jakub Vojvoda
2016-10-02 00:03:45 +02:00
parent aab57d0d1c
commit a5a7289085
2 changed files with 105 additions and 0 deletions

10
state/README.md Normal file
View 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