Is the DOM anemic model / object of anemic value?

The anemic model is a model without ...

“The anemic domain model is the use of a software domain model in which domain objects contain little or no business logic (validation, computation, business rules, etc.).

Is DTO anemic model with no business logic? And again, a balie object without its Logic business?

+3


source to share


1 answer


First of all, resolve the split behavior into two, read behavior and write behavior, so we speak the same language.

Is DTO anemic model with no business logic?

You cannot say that DTO is anemic or not, because DTO is immutable and anemy only makes sense in the area of ​​mutation / write architecture (like Command Command in CQRS), but if we force that term a little, yes, DTO is anemia and has no behavior (neither read nor write) by definition: "A DTO has no behavior other than storing and retrieving its own data ."



A Value object

has behavior (read behavior). For example, it implements behavior to check if two value objects are equal or not.

To expand on the answer a bit, Aggregate roots

both nested and Entities

have write behavior (all kinds of validation).

+3


source







All Articles