All interactive programs are organized around actions. The user presses a key, moves or clicks a mouse, touches the screen, and so on, and the program reacts to that by performing an action. This action frequently has parameters attached to it. For example, a keypress action knows which key was pressed, the screen touch knows the coordinates of a person's touch, and so on. At some time at the very moment the action was triggered the action will result in some operation being executed on some object.
The command pattern helps with organizing such a system by converting actions into objects. Instead of treating the action as a bunch of loosely connected data, the code creates a special object (a command) and stores the action parameters inside this command object. A typical system will know about multiple command types, all of which are realized by subclassing...