Published March 24, 2019
by Doug Klugh

Bundle Data & Functionality

Avoid this code smell by building domain models that encapsulate functionality (business logic, calculations, validations, etc.) along with attributes and properties.  Anemic Domain Models are objects that contain data with little or no associated functionality.  Domain models should not contain just data — that's the purpose of data structures.  Keep your service layer thin.  It should only be used to orchestrate behavior contained within domain objects.