DEV Community

Discussion on: Code Smell 01 - Anemic Models

Collapse
 
dakujem profile image
Andrej Rypo

So, DTOs are an example of the "wrong"? I would use an anemic DTO to transfer low-level data, for example for the database layer. These DTOs are mapped to domain models once they hit the application layer.

Collapse
 
mcsee profile image
Maxi Contieri

This is accidental complexity imposed by the language/architecture you chose and not a developer code smell. If the mapping is done through constructors with validations I guess we can skip it as long as you don't give responsibility to those DTOs.