Skip to Main Content
Get Your Hands Dirty on Clean Architecture
book

Get Your Hands Dirty on Clean Architecture

by Tom Hombergs
September 2019
Beginner content levelBeginner
156 pages
2h 47m
English
Packt Publishing
Content preview from Get Your Hands Dirty on Clean Architecture

Chapter 6

Implementing a Persistence Adapter

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.

Dependency Inversion

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:

Figure 6.1: The services from the core use ports to access the persistence adapter

Our application ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Get Your Hands Dirty on Clean Architecture - Second Edition

Get Your Hands Dirty on Clean Architecture - Second Edition

Tom Hombergs

Publisher Resources

ISBN: 9781839211966Other