What is an "Anemic Domain Model"?
An Anemic Domain Model is an antipattern in which domain objects hold only data, but no behavior.
Signs:
- Entities are just sets of fields with getters and setters.
- All business logic is pushed into services or controllers.
- The Encapsulation principle is broken: data is "naked," and behavior is smeared around.
Example:
python
order.status = "paid" # instead of order.pay()Problem: the code loses its connection to business meaning, rules get duplicated, and testing is hard. DDD solution: bring behavior back into the domain, so objects don't just describe data, but act as participants in the business process.
Short Answer
Interview readyPremium
A concise answer to help you respond confidently on this topic during an interview.