Slicing Persistence Adapters
Learn how to slice persistence adapters.
We'll cover the following
In the previous lesson, we have seen a single persistence adapter class that implements all persistence ports. There is no rule, however, that forbids us to create more than one class as long as all persistence ports are implemented.
We might choose, for instance, to implement one persistence adapter per domain class for which we need persistence operations (or “aggregate” in DDD lingo), as shown in the figure below.
Adapter per aggregate
Get hands-on with 1400+ tech skills courses.