Invoker
in package
Command pattern invoker that processes and executes commands by name.
The Invoker class serves as the command pattern's invoker, responsible for retrieving command objects by name and executing them with provided parameters. It provides a centralized entry point for command execution while maintaining loose coupling between command requestors and command implementations.
Key responsibilities:
- Command retrieval via Factory pattern integration
- Parameter validation and error handling
- Command execution coordination
- Exception handling for missing or invalid commands
- Integration with caching for performance optimization
The invoker uses the Factory pattern to dynamically create command instances based on string identifiers, allowing for flexible command registration and execution without tight coupling to specific command implementations.
Tags
Table of Contents
Methods
- process() : mixed
Methods
process()
public
process(string $action[, array<string|int, mixed>|null $params = null ]) : mixed
Parameters
- $action : string
- $params : array<string|int, mixed>|null = null