give me a
Presentation by Vladimir Minkin
Encapsulate a request as an object, thereby letting users parameterize clients with different requests, queue or log requests, and support undoable operations.
- Client - Invoker - Receiver - ICommand - ConcreteCommand
Invoker (CommandCollector)
ConnectToOracleServerCommand (IServerCommand)
ServerProxy (Receiver)
- checkNetwork
- createConnection
- storeConnection
- informClientWithStatus
.execute()
ApplicationProxy (Receiver)
- getAccessToken
- getCachedData
- updateConnectionType
- doSomethingOnThread
SaveImageContentCommand (IContentCommand)
private Object State
CONTROLLER (Client)
GUI
GUI
GUI
GUI
View
- Encapsulate processing to an Object - Easy functionality replacement - Combining actions - State holder - Delay calls
an object that you can stick in a variable, pass to a function, etc.
Direct execution
to hide unnecessary code.
Command can return value,
even Promise.
- be stored with key for later use (Observer)
- execute another commands (Macros)
- do business logic and act as a brain
- hold and modify state or data
- be sequenced (Async)
- Loose coupling
- No duplication
- Reusable code
- Better Tests
Global object that act as Callback holder and Invoker,
but return Promise
Vladimir Minkin Software-Design
#docoderight
email: vladimir.minkin@gmail.com