The command pattern should be used when: You need a command to have a life span independent of the original request, or if you want to queue, specify and execute requests at different times . You need undo/redo operations. The command’s execution can be stored for reversing its effects.
Read moreWhat is a Command pattern in Java?
A Command pattern is an object behavioral pattern that allows us to achieve complete decoupling between the sender and the receiver . (A sender is an object that invokes an operation, and a receiver is an object that receives the request to execute a certain operation.
Read more