Skipping services
Aside from the incoming ports, for certain use cases, we might want to skip the service layer as a whole, as Figure 11.4 shows.
Figure 11.4 – Without services, we don’t have a representation of a use case in our code base anymore
Here, the AccountPersistenceAdapter class within an outgoing adapter directly implements an incoming port and replaces the service that usually implements an incoming port.
It is very tempting to do this for simple CRUD use cases since in this case a service usually only forwards a create, update, or delete request to the persistence adapter, without adding any domain logic. Instead of forwarding, we can let the persistence adapter implement the use case directly.
This, however, requires a shared model between the incoming adapter and the outgoing adapter, which is the Account domain entity in this case, so it usually means that we’re using the domain model as the input model, as described...