dotnet / dotnet/docs

contradictory information about the use of POCOs in domain layer

Open
#37,852 0 comments 0 reactions 0 assignees View on GitHub
:watch: Not Triaged dotnet-architecture/svc microservices/subsvc
Dominant language
No language data
Stars
4.8k
Forks
6.1k
Avg merge
19h 10m
Merged PRs (30d)
268

Description

### Type of issue

Typo

### Description

I appreciate this article, however the article is contradictory when talking about POCOS and the domain layer. I'm hoping the author can fix this contradictory information. The article describes the Domain layer as:
- "that layer is coded as a class library with the **domain entities** that capture data **plus behavior** (methods with logic)"

yet the article also states this several times:

- "your domain model entity classes should be POCOs"
- "the domain model classes should be Plain Old Class Objects, or [POCO](https://learn.microsoft.com/en-us/dotnet/standard/glossary#poco), classes"
- "Your domain model layer class library should have only your domain code, just POCO entity classes implementing the heart of your software"

That is contradictory... how can you have "methods with logic" in your domain layer, yet the domain layer only consists of POCOs?

The article even has a link to Martin Fowler's discussion on "anemic-domain model" https://martinfowler.com/bliki/AnemicDomainModel.html which is about how using only POCOs (anemic models) for your domain layer is not a good practice.

Thanks for the article! But I think some clarification is needed.

### Page URL

https://learn.microsoft.com/en-us/dotnet/architecture/microservices/microservice-ddd-cqrs-patterns/ddd-oriented-microservice

### Content source URL

https://github.com/dotnet/docs/blob/main/docs/architecture/microservices/microservice-ddd-cqrs-patterns/ddd-oriented-microservice.md

### Document Version Independent Id

5a30bea5-326b-ea72-59ae-dfef1e190e4a

### Article author

jamesmontemagno

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.