205
CHAPTER 6 | Tackle Business Complexity in a Microservice with DDD and CQRS Patterns
Figure 7-10. Domain model structure for the ordering microservice in eShopOnContainers
Additionally, the domain model layer includes the repository contracts (interfaces) that are the
infrastructure requirements of your domain model. In other words, these interfaces express what
repositories and the methods the infrastructure layer must implement. It is critical that the
implementation of the repositories be placed outside of the domain model layer, in the infrastructure
layer library, so the domain model layer is not “contaminated” by API or classes from infrastructure
technologies, like Entity Framework.
You can also see a
SeedWork
folder that contains custom base classes that you can use as a base for
your domain entities and value objects, so you do not have redundant code in each
domain’s object
class.
Dostları ilə paylaş: