O'Reilly logo
  • Bardia Aghabeigi thinks this is interesting:

  • The State Pattern allows an object to have many different behaviors that are based on its internal state.

  • Unlike a procedural state machine, the State Pattern represents state as a full-blown class.

  • The Context gets its behavior by delegating to the current state object it is composed with.

  • By encapsulating each state into a class, we localize any changes that will need to be made.

  • The State and Strategy Patterns have the same class diagram, but they differ in intent.

  • Strategy Pattern typically configures Context classes with a behavior or algorithm.

  • From

    Cover of Head First Design Patterns


    bullet points