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 command service. As the edge is responsible for authentication and some authorization, 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 provides several ways to implement the application layer, described in this section.
📄️ Command service
Command service and unit of work for aggregates
📄️ Functional service
Functional command service and unit of work without aggregates
📄️ Command API
Auto-generated HTTP API for command handling
📄️ Command mapping
Mapping contracts to domain commands