-
-
Notifications
You must be signed in to change notification settings - Fork 0
Command Router
Iuga Alexandru edited this page May 16, 2023
·
1 revision
It is responsible for instantiating and executing the appropriate ICommand object.
For its job, the router needs two types of data:
-
available commands
- also known as Command Metadata Model.
- a list with information about all the classes that represent a command.
- obtained using reflection from the assembly provided at setup time.
-
command request
- Also known as Command Request Model.
- Contains all the data from the user's command line request.
What the Command Router remains to do is:
-
identify command - Search in the list of available commands for the one specified by the Command Request Model.
-
instantiate command
- populate command parameters - This is done based on the metadata with values from the text command.
-
execute command
- A
ICommandinstance which is immediately executed.