Roles

[Previous] [Next]

Here are the roles and functions of the State design pattern:

  • State Specifies an interface expected by clients that encapsulates the behavior of a concrete State class instance. This interface is referred to as State because concrete classes that implement this interface are expected to be sensitive to state changes.
  • ConcreteState subclasses Each subclass implements behavior associated with a specific state. The subclass doesn't maintain its state in local data-member variables. Instead it defers state management to the CentralStateManager object.
  • CentralStateManager A concrete class that performs the following actions:
    • Serves as the single central repository for all state objects within a State design pattern instance. State is determined based on the values of data member variables.
    • Defines intelligent state transition behavior by returning a reference to the appropriate ConcreteState object based on the current state. This results in dynamic behavior changes.


Microsoft Visual Basic Design Patterns
Microsoft Visual Basic Design Patterns (Microsoft Professional Series)
ISBN: B00006L567
EAN: N/A
Year: 2000
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net