Command is a behavioral pattern that turns a request into a stand-alone object containing all information about the request. This transformation lets you parameterize methods with different requests, delay or queue a request's execution, and support undoable operations. Think of a restaurant order slip: the waiter writes your order (the command object) and passes it to the kitchen — the waiter doesn't cook, and the kitchen doesn't talk to you directly.
ℹ️Core idea: encapsulate a request as an object, thereby letting you parameterize clients, queue or log requests, and support undo/redo. The invoker fires commands without knowing what they do; the receiver does the actual work.
Content is available with subscription.
Get full access to all courses on the platform for one year with a single payment.
▼
Unlike other platforms that charge per course, here you get everything for one price, and after one year of use there will be no automatic charge for the following year.