POCOs domain classes and anemic domain model
- Dominant language
- No language data
- Stars
- 4.8k
- Forks
- 6.1k
- Avg merge
- 19h 10m
- Merged PRs (30d)
- 268
Description
Following the link to POCO's definition we see that they should include only props/fields and no methods. In this article we see that domain model classes should be POCOs. Isn't that the definition of an anemic domain model?
More specifically in [this page](https://learn.microsoft.com/en-us/dotnet/standard/glossary#poco) you can find the definition of a POCO. It states that:
A POCO—or a plain old class/[CLR](https://learn.microsoft.com/en-us/dotnet/standard/glossary#clr) object—is a .NET data structure that contains only public properties or fields. A POCO shouldn't contain any other members, such as:
- methods
- events
- delegates
These objects are used primarily as data transfer objects (DTOs). A pure POCO will not inherit another object, or implement an interface. It's common for POCOs to be used with serialization.
Then below Figure 7-5 we see:
---

---
which means they should include props/fields and no methods.
And then we see [the page](https://learn.microsoft.com/en-us/dotnet/architecture/microservices/microservice-ddd-cqrs-patterns/microservice-domain-model#rich-domain-model-versus-anemic-domain-model):
---

---
and
---

---
from which I undestand that using POCOs for your domain models, the way POCO is defined above, results in an anemic model. That is why I am confused.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
ID: 95f3dcd7-3220-e9cf-3ca6-90b1282410ec
Version Independent ID: 5a30bea5-326b-ea72-59ae-dfef1e190e4a
Content: [Designing a DDD-oriented microservice](https://learn.microsoft.com/en-us/dotnet/architecture/microservices/microservice-ddd-cqrs-patterns/ddd-oriented-microservice)
Content Source: [docs/architecture/microservices/microservice-ddd-cqrs-patterns/ddd-oriented-microservice.md](https://github.com/dotnet/docs/blob/main/docs/architecture/microservices/microservice-ddd-cqrs-patterns/ddd-oriented-microservice.md)
Product: dotnet-architecture
Technology: microservices
GitHub Login: @nishanil
Microsoft Alias: nanil
Contributor guide
Assessment
This issue has not been assessed yet.