Return to site

C callback design pattern

broken image
broken image
broken image

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.

broken image

Usage examples: The Command pattern is pretty common in C++ code.

broken image