Change my State

Photo by Aaron Burden
Talk about State Design Pattern
created by Vladimir Minkin

Object Conditions

  1. Object behave or looks differently depends on conditions statements.
     
  2. This conditions duplicates over the code.
     
  3. Consumer does not care about implementation. Only object knows about its states.

 

Encapsulate what Varies

 

Favor Composition over Inheritance

The state pattern can be interpreted as a strategy pattern. 
Which is able to switch the current strategy through invocations of methods defined in the pattern's interface.

Change my State

By Vladimir Cores Minkin

Change my State

Talk about State Pattern

  • 592