Skip to content

contradictory information about the use of POCOs in domain layer #37852

Open
@andynewcomb

Description

@andynewcomb

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, 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions