State pattern

Design pattern that allows an object to alter its behavior when its internal state changes, e.g. a strategy pattern, akin to finite-state machines

The state pattern is a behavioral software design pattern that allows an object to alter its behavior when its internal state changes. This pattern is close to the concept of finite-state machines.

Nº Q230866 ★

Common · Knowledge

State pattern

Design pattern that allows an object to alter its behavior when its internal state changes, e.g. a strategy pattern, akin to finite-state machines

The state pattern is a behavioral software design pattern that allows an object to alter its behavior when its internal state changes. This pattern is close to the concept of finite-state machines.

Last price

—

Floor price

—

7-day median

—

30-day sales

0

30-day range

—

In circulation

0

Price history

Show table
Datemedian LowHighsales

Sales history

Last sale
—
30-day average
—
30-day low
—
30-day high
—
Sales 7d
0
Sales 30d
0

No sales yet.

Anonymous sales: no buyer or seller shown. Figures count player-to-player sales only.

From Wikipedia

The state pattern is a behavioral software design pattern that allows an object to alter its behavior when its internal state changes. This pattern is close to the concept of finite-state machines. The state pattern can be interpreted as a strategy pattern, which is able to switch a strategy through invocations of methods defined in the pattern's interface. The state pattern is used in computer programming to encapsulate varying behavior for the same object, based on its internal state. This can be a cleaner way for an object to change its behavior at runtime without resorting to conditional statements and thus improve maintainability.

Text: Wikipédia, CC BY-SA 4.0. · Image: State_Design_Pattern_UML_Class_Diagram.png: JoaoTrindade (ta... (CC BY-SA 3.0) ·

Related cards

View card

Confirmation