Command

E173615

Command is a behavioral design pattern that encapsulates a request as an object, allowing parameterization, queuing, logging, and support for undoable operations.

All labels observed (3)

Label Occurrences
Command pattern 2
Command canonical 1
Command (design pattern) 1

How this entity was disambiguated

Statements (46)

Predicate Object
instanceOf behavioral design pattern
design pattern
allows parameterization of clients with different requests
alsoKnownAs Action
Transaction
appearsIn Design Patterns: Elements of Reusable Object-Oriented Software
belongsTo Design Patterns: Elements of Reusable Object-Oriented Software
surface form: Gang of Four design patterns
canBeImplementedWith callbacks
function objects or functors
lambda expressions
canIncrease number of small command classes
Client creates ConcreteCommand objects
ConcreteCommand binds a Receiver to an action
decouples invoker from receiver
object that invokes operation from object that knows how to perform it
defines command interface with execute operation
enables dynamic reconfiguration of commands at runtime
macro commands
replay of operations
transaction-like group of operations
encapsulates request as an object
Invoker stores and invokes commands
oftenDefines undo operation
oftenUsedWith Composite pattern for macro commands
Invoker objects like buttons or menu items
Memento pattern for undo
participantsInclude Client
Command interface
ConcreteCommand
Invoker
Receiver
promotes open-closed principle
single responsibility principle
Receiver knows how to perform the work
supports history of executed commands
logging of requests
queuing of requests
undoable operations
typicalMethodName execute
undo
usedFor implementing undo-redo stacks
job queues
macro recording
menu actions in GUIs
task scheduling systems
toolbar actions in GUIs

How these facts were elicited

Referenced by (4)

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

Chain of Responsibility relatedTo Command
this entity surface form: Command pattern
Memento relatedTo Command
subject surface form: Memento (design pattern)
this entity surface form: Command (design pattern)
Visitor relatedTo Command
this entity surface form: Command pattern