September 2019
Beginner
156 pages
2h 47m
English
In Chapter 1, What's Wrong with Layers?, I ranted about the traditional layered architecture and claimed that it supports "database-driven design" because, in the end, everything depends on the persistence layer. In this chapter, we will have a look at how to make the persistence layer a plugin to the application layer to invert this dependency.
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 ...