What is Command pattern?
- A design pattern that converts a request into a standalone object, allowing the client to parametrize objects with different requests, queue a request, or log requests
- A design pattern that passes a request through a chain of objects, allowing the objects in the chain to either handle the request or pass it on to the next object in the chain
- A design pattern that provides a simplified interface to a complex system, allowing the client to interact with the system through a single, unified interface
- A design pattern that uses shared objects to support large numbers of similar objects efficiently
Command pattern is a design pattern that converts a request into a standalone object, allowing the client to parametrize objects with different requests, queue a request, or log requests. The pattern involves creating a command class that encapsulates the request as an object, and passes the request to the invoker object. The invoker object then executes the command. This pattern can be useful in situations where you want to decouple the client from the receiver of the request, and where you want to provide a unified interface for undo and redo operations.
Loading...