Command
Usage
- Also known as: Action; Transaction
- Encapsulate a command request as an object
- Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations
Diagram
Participants
Command
ConcreteCommand
- Declares an interface for executing an operation
Client
- Defines a binding between a Receiver object and an action
- Implements Execute by invoking the corresponding operation(s) on Receiver
Invoker
- Creates a ConcreteCommand object and sets its receiver
Receiver
- Asks the command to carry out the request
- Knows how to perform the operations associated with carrying out the request.
Resources URL:
notes/design_patterns/resources
Sources URL:
notes/design_patterns/sources
