State Pattern

Intent: Allow an object to alter its behavior when its internal state changes. The object will appear to change its class.

See also: StrategyPattern, DynamicClassification, RunAndReturnSuccessor, ContextParameter

DualityBetweenStateAndClass gives a more philosophical discussion of why an object's "state" deserves to be modeled in a separate class. (BrokenLink - not working 20120327) (BrokenLink - not working 20071203)

In Chapter 9 of PatternLanguagesOfProgramDesign volume three, PaulDyson and BruceAnderson present seven "state" patterns in a PatternLanguage, explaining the costs and benefits of various implementation strategies of this pattern. (CategoryGroupsOfPatterns)

See also(?): ClientState

CategoryPattern | CategoryBehavioralPatterns

EditText of this page (last edited March 27, 2012) or FindPage with title or text search