Distinguish the Command roles in Java so request creation, request invocation, and actual work execution stay properly separated.
The Command pattern is easiest to reason about when its three roles stay distinct.
flowchart LR
A["Client"] --> B["Creates command"]
B --> C["Invoker"]
C --> D["Calls execute()"]
D --> E["Command"]
E --> F["Receiver performs real work"]
The invoker decides when to run the command. It should not need receiver-specific details.
The command packages the request, binding any required inputs and receiver reference.
The receiver owns the real business action.
If the invoker still knows receiver details or if the command does the entire business workflow itself, the role separation is collapsing.