Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations
execute()
stores state for reversal, unexecute()
reverses the effects of a previous execute()
. Executed commands are stored in a history list, with unlimited undo and redoexecute()
by invoking the corresponding operation(s) on Receiverexecute()
on the command. When commands are undoable, ConcreteCommand stores state for undoing the command before invoking Execute.