December 2002
Intermediate to advanced
648 pages
19h 53m
English
The problem is that you may want to ask an object to do something, but you don’t know exactly when the object will carry out the request or exactly how it will do it.
The solution, as shown in Figure 5.4, is to create a Command object that represents which command you want executed, possibly with information about which target object is supposed to be affected by the command’s execution.

Often the Command pattern is used in partnership with a CommandProcessor that holds the collection of commands that still need to be executed. The CommandProcessor can be derived from an array template or a linked ...
Read now
Unlock full access