The “No Mapping” strategy
The first strategy is actually not mapping at all.
Figure 9.1 – If the port interfaces use the domain model as the input and output model, we can choose not to map between layers
Figure 9.1 shows the components that are relevant for the Send Money use case from our BuckPal example application.
In the web layer, the web controller calls the SendMoneyUseCase interface to execute the use case. This interface takes an Account object as an argument. This means that both the web and application layers need access to the Account class – both are using the same model.
On the other side of the application, we have the same relationship between the persistence and application layer.
Since all layers use the same model, we don’t need to implement mapping between them.
But what are the consequences of this design?
The web and persistence layers may have special requirements for their models...