Design Patterns · Middle · Question 49 of 75
What is an "anemic model", and why is it criticized?
- ✓Correct answer: Objects are just data; the logic lives separately in services
- 2A data model without indexes in the database, which makes queries slow
- 3A model with an excessive number of methods and behavior
Explanation
Fowler calls it an anti-pattern in OOP: data and the rules for changing it are separated, so invariants are easy to break. On a functional-style frontend, "data + pure functions side by side in one module" is a reasonable compromise, as long as the rules are concentrated in one place.