Intent Allow an object to alter its behavior when its internal state changes. The object will appear to change its class. An object-oriented state machine wrapper + polymorphic wrappee + collaboration Problem A monolithic object's behavior is a function of its state, and it must change its behavior at run-time depending on that state. Or, an application is characterixed by large and numerous case statements that vector flow of control based on the state of the application. Discussion The State pattern is a solution to the problem of how to make behavior depend on state.
Read full article from State Design Pattern
No comments:
Post a Comment