Command (cont’d)
Consequences
- decouples invoker from receiver
- commands are first class objects that can be passed around etc.
- it is easy to add new commands
- invoker only knows a simple interface
Implementation
- command can have a wide range of abilities
- support undo/redo