Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations.
One of the interesting aspects of the Command design pattern is that it serves several purposes. This results in higher-level design patterns - patterns where the Command design pattern is combined in predictable ways with other design patterns.
When the Command design pattern is used to support user actions in a graphical user interface, some of the Command participants also are participants in the Observer design pattern.
A complex command can be broken down into a sequence of simpler commands. The cleanest way of supporting this decomposition is to use the Composite design pattern.
A command may be undoable. This often involves the Memento design pattern.
The Java javax.swing and javax.swing.text packages contain several classes that jointly illustrate the Command design pattern.