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 (2)
| Label | Occurrences |
|---|---|
| State canonical | 1 |
| State pattern | 1 |
How this entity was disambiguated
This entity first appeared as the object of triple T1531332 — resolving that mention is where its identity was fixed. The disambiguator weighed these candidate entities and picked the highlighted one (or “None”, minting a new entity). This is how homonymy is resolved: the same surface form can point to different entities.
Target entity: State Context triple: [Design Patterns: Elements of Reusable Object-Oriented Software, describesPattern, State]
-
A.
State
State is an underground subway station in downtown Boston that serves as a major transfer point between the MBTA Blue and Orange Lines.
-
B.
STATE
STATE is the commonly used abbreviation for the United States Department of State, the federal executive department responsible for U.S. foreign policy and international relations.
-
C.
Province I
Province I is an administrative ecclesiastical region of The Episcopal Church in the United States, encompassing several dioceses in the New England area.
-
D.
State Circle
State Circle is a historic circular street in Annapolis, Maryland, that encircles the Maryland State House and serves as a central hub of the city's colonial-era layout.
-
E.
States General
The States General is the bicameral national parliament of the Netherlands, consisting of the House of Representatives and the Senate.
- F. None of above. chosen
- G. Unsure - the case is ambiguous/there is not enough information to decide.
Target entity: State Target entity description: 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.
-
A.
State
State is an underground subway station in downtown Boston that serves as a major transfer point between the MBTA Blue and Orange Lines.
-
B.
STATE
STATE is the commonly used abbreviation for the United States Department of State, the federal executive department responsible for U.S. foreign policy and international relations.
-
C.
Province I
Province I is an administrative ecclesiastical region of The Episcopal Church in the United States, encompassing several dioceses in the New England area.
-
D.
State Circle
State Circle is a historic circular street in Annapolis, Maryland, that encircles the Maryland State House and serves as a central hub of the city's colonial-era layout.
-
E.
States General
The States General is the bicameral national parliament of the Netherlands, consisting of the House of Representatives and the Senate.
- F. None of above. chosen
Statements (48)
| Predicate | Object |
|---|---|
| instanceOf | behavioral design pattern ⓘ |
| alsoKnownAs |
State
ⓘ
surface form:
State pattern
|
| 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 NERFINISHED ⓘ 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 ⓘ
surface form:
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
The pipeline generated the facts above by prompting gpt-5.1 with this entity's name + description and the instruction below.
You are a knowledge base construction expert. Given a subject entity and a description of it, return factual statements that you know for the subject as a JSON list of dictionaries(triples), where keys must be "subject", "predicate" and "object". The number of facts may be very high, between 25 to 50 or more, for very popular subjects. For less popular subjects, the number of facts can be very low, like 5 or 10. # Requirements - If you don't know the subject at all, return an empty list. - If the subject is not a named entity, return an empty list. - Include at least one triple where predicate is "instanceOf". - Do not get too wordy. - Separate several objects into multiple triples with one object.
Subject: State Description of subject: 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.
Referenced by (2)
Full triples — surface form annotated when it differs from this entity's canonical label.