Mehmet Eroğlu’s Post

View profile for Mehmet Eroğlu, graphic

C++ Developer - AYOFF

Command Design Pattern By encapsulating a request as an object, the Command Pattern is a behavioral design pattern that enables parameterizing clients with various requests, queuing requests, and recording requests. Moreover, it offers assistance with undoable operations. When you wish to separate the entity requesting it from the one sending it, this approach is really helpful. Here is a basic implementation of a Command Pattern Command ; This defines an abstract interface for executing operations. It typically has an execute() function method. Concrete Commands; These classes define the binding between an action and a Receiver object and implement the Command interface. They invoke methods on the receiver to fulfill the request. Receiver: Axis ; This is the thing that gets the job done. It is capable of carrying out the tasks that the order demands. Invoker: This is the thing that has a command and uses it to carry out the request. It is unaware of the purpose of the command.

  • text

To view or add a comment, sign in

Explore topics