Implementation Overview
Earlier it was mentioned that in order to implement behavior for a solution Commands, Services, Events and Operations are used.
These elements have scope with regards to what they can call or be called from, below is a description of each elements and scope of elements it can call
Factory Command
Creates an instance of a root entity and persists it in the datastore.
Inside Factory Command, solution engineers can call Events
Inside a factory command implementations there is a function called
available()
. This is used to check the necessary pre-conditions
of the command. If the function returns true
then the command will
be executed, otherwise, the command will not be executed at all.
Instance Command
Manipulates the values of one or more properties of an already existent instance of an entity.
Inside Instance Command, solution engineers trigger Events
Inside an instance command implementations there is a function called
available()
. This is used to check the necessary pre-conditions
of the command. If the function returns true
then the command will
be executed, otherwise, the command will not be executed at all.
Domain Service
Can perform operations throughout different domain namespaces.
Inside Domain Service, solution engineers can call Factory Command, Instance Command, Domain Service, and Events
Events
They are published to indicate that some action
An event that is successfully published will automatically execute the script of the Agent that is related to this event.
Agents
When an event is triggered, then agents are automatically executed as consequence of the action that triggered the event.
Inside Agents, solution engineers can call Factory Command, Instance Command, Domain Service, and trigger Events
Operation
Can perform operations throughout different domain namespaces.
Inside Operation, solution engineers can call Factory Command, Instance Command, Domain Service
Illustrative table for the scope of implementation elements
CALLEE | |||||||
CALLER | Factory command | Instance command | Domain service | Events | Agent | Operation | |
Factory command | √ | ||||||
Instance command | √ | ||||||
Domain service | √ | √ | √ | √ | |||
Events | √ | ||||||
Agent | √ | √ | √ | √ | |||
Operation | √ | √ | √ |