Rich versus anemic domain model
Our architecture style leaves open how to implement our domain model. This is a blessing because we can do what seems right in our context, and a curse because we don’t have any guidelines to help us.
A frequent discussion is whether to implement a rich domain model following the DDD philosophy or an “anemic” domain model. Let’s discuss how each of these fits into our architecture.
In a rich domain model, as much of the domain logic as possible is implemented within the entities at the core of the application. The entities provide methods to change the state and only allow changes that are valid according to the business rules. This is the way we pursued the Account entity previously. Where is our use case implementation in this scenario?
In this case, our use case serves as an entry point to the domain model. A use case then only represents the intent of the user and translates it into orchestrated method calls to...