State

E173619

State is a behavioral design pattern that lets an object alter its behavior when its internal state changes, making it appear as if the object has changed its class.

All labels observed (3)

Label Occurrences
State canonical 1
State (design pattern) 1
State pattern 1

How this entity was disambiguated

Statements (48)

Predicate Object
instanceOf behavioral design pattern ⓘ
alsoKnownAs State pattern ⓘ
linked to: State
alters object behavior based on internal state ⓘ
appliesWhen object behavior depends on its state ⓘ
operations have large conditional statements that depend on object state ⓘ
benefit improves code maintainability ⓘ
localizes state-specific behavior ⓘ
simplifies adding new states ⓘ
canBeImplementedWith abstract classes ⓘ
interfaces ⓘ
category object-oriented design pattern ⓘ
commonExample TCP connection states ⓘ
UI widget states ⓘ
document lifecycle states ⓘ
contextHolds reference to a State object ⓘ
defines separate state objects ⓘ
describedIn Design Patterns: Elements of Reusable Object-Oriented Software ⓘ
differsFrom Strategy (design pattern) by modeling intrinsic states rather than interchangeable algorithms ⓘ
effect makes object appear to change its class ⓘ
encapsulates state transitions ⓘ
state-specific behavior ⓘ
firstPublished 1994 ⓘ
intent allow an object to alter its behavior when its internal state changes ⓘ
languageAgnostic true ⓘ
originatedBy Erich Gamma ⓘ
John Vlissides ⓘ
Ralph Johnson ⓘ
Richard Helm ⓘ
participants ConcreteState ⓘ
Context ⓘ
State interface ⓘ
partOf Gang of Four design patterns ⓘ
reduces complex conditional statements ⓘ
relatedTo Strategy (design pattern) ⓘ
separates state-specific logic from context object ⓘ
stateObject implements behavior associated with a particular state ⓘ
supports finite state machine modeling ⓘ
open/closed principle ⓘ
runtime state transitions ⓘ
tradeoff increases number of classes ⓘ
typicalConcreteStateResponsibility implement behavior for a particular state ⓘ
typicalContextClassResponsibility delegate requests to current state object ⓘ
maintain current state ⓘ
typicalStateInterfaceResponsibility declare state-specific operations ⓘ
usedFor removing state-dependent conditionals from client code ⓘ
usedIn object-oriented programming ⓘ
uses composition ⓘ
delegation ⓘ

How these facts were elicited

Referenced by (3)

Full triples — surface form annotated when it differs from this entity's canonical label.

State (design pattern) → alsoKnownAs → State pattern ⓘ
subject linked to: State
linked to: State
Memento (design pattern) → relatedTo → State (design pattern) ⓘ
linked to: State