Julie Lerman. Data Points - Coding for Domain-Driven Design: Tips for Data-Focused Devs https://learn.microsoft.com/archive/msdn-magazine/2013/august/data-points-coding-for-
domain-driven-design-tips-for-data-focused-devs
•
Udi Dahan. How to create fully encapsulated Domain Models https://udidahan.com/2008/02/29/how-to-create-fully-encapsulated-domain-models/
•
Steve Smith. What is the difference between a DTO and a POCO?
https://ardalis.com/dto-
or-poco/
Seedwork (reusable base classes and interfaces for
your domain model)
The solution folder contains a
SeedWork folder. This folder contains custom base classes that you can
use as a base for your domain entities and value objects. Use these base classes s
o you don’t have
redundant code in each domain’s object class. The folder for these types of classes is called
SeedWork and not something like
Framework . It’s called
SeedWork because the folder contains just a small
subset of reusable classes that cannot really be considered a framework.
Seedwork is a term
introduced by
Michael Feathers
and popularized by
Martin Fowler
but you could also name that
folder Common, SharedKernel, or similar.
Figure 7-12 shows the classes that form the seedwork of the domain model in the ordering
microservice. It has a few custom base classes like Entity, ValueObject, and Enumeration, plus a few
interfaces. These interfaces (IRepository and IUnitOfWork) inform the infrastructure layer about what
needs to be implemented. Those interfaces are also used through Dependency Injection from the
application layer.
Figure 7-12 . A sample set of domain model “seedwork” base classes and interfaces This is the type of copy and paste reuse that many developers share between projects, not a formal
framework. You can have seedworks in any layer or library. However, if the set of classes and
interfaces gets large enough, you might want to create a single class library.
211
CHAPTER 6 | Tackle Business Complexity in a Microservice with DDD and CQRS Patterns