196
CHAPTER 6 | Tackle Business Complexity in a Microservice with DDD and CQRS Patterns
Figure 7-5. DDD layers in the ordering microservice in eShopOnContainers
The three layers in a DDD microservice like Ordering. Each layer is a VS project: Application layer is
Ordering.API, Domain layer is Ordering.Domain and the Infrastructure layer is Ordering.Infrastructure.
You want to design the system so that each layer communicates only with certain other layers. That
approach may be easier to enforce if layers are implemented as different class libraries, because you
can clearly identify what dependencies are set between libraries. For instance, the domain model layer
should not take a dependency on any other layer (the domain model classes should be Plain Old Class
Objects, or
POCO
, classes). As shown in Figure 7-6, the
Dostları ilə paylaş: