this pattern is used when an object change its behavior based on its internal state.
- Context - main class that receive the request
- State - the class that gonna give that request to proper class
- ConcreteState - class that take action on request diffrently from another concretestate class
- Interface State - contains handle methods
Context |
---|
+request() |
State |
---|
-handle() |
ConcreteStateA |
---|
-handle() |
ConcreteStateB |
---|
-handle() |