Coherence Implementation

As we did with the collection-oriented Repository, we first define an interface and then its implementation. Here’s a persistence-oriented interface that defines save-based methods that are used for the Oracle Coherence data grid:

package com.saasovation.agilepm.domain.model.product; import java.util.Collection; import com.saasovation.agilepm.domain.model.tenant.Tenant; public interface ProductRepository  {     public ProductId nextIdentity();     public Collection<Product> allProductsOfTenant(Tenant aTenant);     public Product productOfId(Tenant aTenant, ProductId aProductId);     public void remove(Product aProduct);     public void removeAll(Collection<Product> aProductCollection); ...

Get Implementing Domain-Driven Design now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.