Member-only story

Why you shouldn’t have a Anemic Domain Model in your project

Bending the Clean Architecture Principles

Anthony Trad
6 min readDec 9, 2022
Anemic DD memes

What is an Anemic Domain Model?

An anemic domain model is a software design pattern in which the domain model, or the core business logic of the application, is represented only by a set of data transfer objects (DTOs) and associated getters and setters. This type of design is often used in object-oriented programming languages, such as C#, to represent the data and behavior of the domain model.

Problems with Anemic Domain Models

An anemic domain model has several problems and drawbacks, which can make it difficult to maintain and extend the application over time. Some of the key problems with anemic domain models are:

Lack of domain logic

An anemic domain model consists only of data transfer objects and their associated getters and setters. This means that the domain logic, or the business rules and behavior of the domain model, is not represented in the code. This can make it difficult to understand and maintain the application, and can lead to errors and inconsistencies in the behavior of the application.

Tight coupling to the persistence layer

--

--

Anthony Trad
Anthony Trad

Written by Anthony Trad

Senior Software Engineer focused on .NET and the Cloud. Reconsidering major principles and patterns, ideas are my own.

No responses yet