Command

Encapsulate a request as an object, thereby letting you parameterize clients with
different requests, queue or log requests, and support undoable operations.
Applicability
- Need to replace callbacks by an object-oriented form
- Need to specify, queue, and execute requests at different times.
- Need to support undo
- Need to support logging chains
- Need to structure a system around high-level operations built on primitive operations
Consequences
- Decouples the object that invokes the operation from the one that knows how to
perform it.
- Commands become first-class objects
- Commands can be assembled into composite commands
- Easy to add new commands