CSC/ECE 517 Fall 2012/ch1b 2w41 dc

From Expertiza_Wiki
Revision as of 20:22, 19 November 2012 by Vmunuku (talk | contribs)
Jump to navigation Jump to search

State pattern and the related patterns

The State pattern allows an object to completely change its behavior and the change depends on its current internal state. Alternatively, a monolithic object's behavior is a function of its state, and it must change its behavior at run-time depending on that state. State pattern is closely related to Strategy pattern and Bridge pattern. We shall discuss the three patterns, their structures, advantages & disadvantages.

Description

The state pattern is behavioral as it defines how communication between classes or entities is controlled. It is used in programming to define the state of an object.