-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Get Your Hands Dirty on Clean Architecture
By :
Instead of a persistence layer, we will talk about a persistence adapter that provides persistence functionality to the application services.
The following figure shows how we can apply the Dependency Inversion Principle to do just that:
Our application services call port interfaces to access persistence functionality. These ports are implemented by a persistence adapter class that does the actual persistence work and is responsible for talking to the database.
In hexagonal architecture lingo, the persistence adapter is a "driven" or "outgoing" adapter, because it's called by our application and not the other way around.
The ports are effectively a layer of indirection between the application services and the persistence code. Let's remind ourselves that we are adding this layer of indirection in order to be able to evolve the domain code without...
Change the font size
Change margin width
Change background colour