December 2017
Intermediate to advanced
468 pages
13h 12m
English
This pattern suggests encapsulation of requests as an object, parameterizing clients with different requests; it can placed over message queues, can be logged, and supports undo operations.

The preceding diagram depicts the structure of a command pattern and a sample implementation for a stockbroker application classes. <<StockOrder>> interface is a Command, and Stock concrete class creates requests. Buy and Sell are concrete classes implementing the <<StockOrder>>. The StockBroker is an invoker, and its objects execute specific commands depending on the type that it receives.
Here are the benefits:
Read now
Unlock full access