Application service and unit of work
The application layer sits between the system edge (different APIs), and the domain model. It is responsible for handling commands coming from the edge.
In general, the command handling flow can be described like this:
- The edge receives a command via its API (HTTP, gRPC, SignalR, messaging, etc).
- It passes the command over to the application service. As the edge is responsible for authentication and some authorisation, it can enrich commands with user credentials.
- The command service, which is agnostic to the API itself, handles the command and gives a response to the edge (positive or negative).
- The API layer then returns the response to the calling party.
Eventuous gives you a base class to implement command services in the application layer: the
Auto-generated HTTP API for command handling