Context:

Initiator of action cannot (or need not) be there in time to launch the action (e.g. scheduling, selection from menu). Possibly, action may be undone later.

Challenge:

To encapsulate the execution request with its arguments (and possibly its undo arguments).

Skill:

Participants:

Client:

Initiates the request. Creates a Concrete Command over the Receiver, which it registers with the Invoker.

Invoker:

A heterogeneous container of commands. Responsible for activating the commands at the proper event.

Command:

The Invoker's generic contents. The capability to delay execution and store its parameters. Possibly also to undo it.

Concrete Command:

the capability to activate a particular receiver.

Receiver:

The object of the request.

Signature:

Invoker contains Commands. Concrete Command references Receiver. Client references (or contains) both Receiver and Invoker, creates the Command and registers it with Invoker.

Used by:

Order of initialization pattern, Observer pattern, menu systems, transaction-based systems.

Scope:

Languages that do not support bound methods / delegates. General (when involving more data or functionality than just the receiver, method and invoke-time arguments).