This example illustrates the structure of the Command design pattern. Command classes are usually limited to specific actions. Identification: The Command pattern is recognizable by behavioral methods in an abstract/interface type (sender) which invokes a method in an implementation of a different abstract/interface type (receiver) which has been encapsulated by the command implementation during its creation. It’s also used for queueing tasks, tracking operations history, etc. Most often it’s used as an alternative for callbacks to parameterizing UI elements with actions.
Usage examples: The Command pattern is pretty common in C++ code.