State Pattern

The state pattern, which closely resembles Strategy Pattern, is a behavioral software design pattern, also known as the objects for states pattern. This pattern is used in computer programming to represent the state of an object. This is a clean way for an object to partially change its type at runtime.

Famous quotes containing the words state and/or pattern:

    “To one who habitually endeavors to contemplate the true state of things, the political state can hardly be said to have any existence whatever. It is unreal, incredible, and insignificant to him, and for him to endeavor to extract the truth from such lean material is like making sugar from linen rags, when sugar-cane may be had.”
    —Henry David Thoreau (1817–1862)

    “Although the pattern prevailed,
    The breaks were everywhere. That she could think
    Of no thread capable of the necessary
    Sew-work.”
    —Gwendolyn Brooks (b. 1917)