Are We Still Doing OOP? π€ Let's Tackle Anemic Domain Models Together
summary
Claims that splitting state and behavior causes duplicated business checks and fragile change; demonstrates with a banking example where moving withdraw from a service into the bank account makes balance private, enforces checks centrally, and prevents scattered mutations. Lists clear detectors: domain objects with only getters/setters, vague service/manager classes that only mutate others, and services with no state. Cites Martin Fowler and recommends bringing state and behavior together to improve cohesion, readability, and maintainability.
AI-written summary Β· about
