Persistence-Oriented Repositories
For times when a collection-oriented style doesn’t work, you will need to employ a persistence-oriented, save-based Repository. This will be the case when your persistence mechanism doesn’t implicitly or explicitly detect and track object changes. This happens to be the case when using an in-memory Data Fabric (4), or by any other name a NoSQL key-value data store. Every time you create a new Aggregate instance or change a preexisting one, you will have to put it into the data store by using save() or a save-like Repository method.
There is another consideration for choosing a persistence-oriented approach, even if you are using an object-relational mapper that supports a collection-oriented approach. What would ...
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.
Read now
Unlock full access