Commmand Pattern
Behavioural Pattern.
Pattern explenation Intent Encapsulate a request as an object, thereby letting you parametrize clients with different requests, queue or log requests, and support undoable operations.
What it solve Need to issue requests to objects without knowing anything about the operation being requested or the receiver of the request.
Applications To parameterize objects with respect to an action to be performed To specify, queue and execute requests at different times To allow the cancellation of operations To organize a system into high-level operations which are themselves based on primitive operations Actors Command Specifies an interface for performing a generic operation ConcreteCommand Defines a link between a target object and an action Implement the Execute method by invoking the corresponding method (s) on the Receiver Keeps the data of the action Client Create a concrete instance of Command and set its Receiver Invoker Asks Command to complete the request Keeps the history of ConcreteCommand used Receiver Knows the way to perform the operations associated with a request.