Skip to main content

Command

The Command design pattern encapsulates a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations.

Usage     Usage     Medium-low

UML class diagram​

A visualization of the classes and objects participating in this pattern.

diagram

Sample code​

This structural code demonstrates the Command pattern which stores requests as objects allowing clients to execute or playback the requests.

Output​

See also​

​