Are Anemic Domain Models bad?

Are Anemic Domain Models bad?

One could say that the Anemic Domain Model is not going along with Object-Oriented Design. The separation of logic into other class is just not correct in OOD approach. But it is not the primary reason why Anemic Domain Model is harmful. Having a pure OOD is not the goal in and of itself.

Why is anemia domain model bad?

In essence the problem with anemic domain models is that they incur all of the costs of a domain model, without yielding any of the benefits. The primary cost is the awkwardness of mapping to a database, which typically results in a whole layer of O/R mapping.

What does anemia fatigue feel like?

People who are anemic most often experience fatigue. While it’s normal to feel tired after a long day at work or a heavy exercise session, when you’re anemic, you feel weary after shorter and shorter periods of exertion as your body’s cells become starved for oxygen.

When to use anemic domain models in DDD?

During a discussion about how to best implement our domain objects when applying DDD, which has recently become more and more popular, a colleague pointed me to Martin Fowler’s article about Anemic Domain Models (2003).

Who is the founder of the anemic model?

Anemic Model is a Domain Model where Domain Objects contain little or no business logic. This model was first described by Martin Fowler, who considers the practice an antipattern. The fundamental horror of this anti-pattern is that it’s so contrary to the basic idea of object-oriented design; which is to combine data and process together.

Is the anaemic domain model an anti pattern?

The Anaemic Domain Model is no Anti-Pattern, it’s a SOLID design. As domain logic is expressed in the domain entity, and the concrete domain entity exposes the interface to the domain logic, implementations are tightly coupled such that the effects of changes cascade, which in turn makes automated tests brittle.

Why is Martin Fowler against the anemic domain model?

In the aforementioned article, Martin uses rather opinionated language to say that the Anemic Domain Model is an anti-pattern ‘robbing yourself blind’. So he must have (or at least must have had) good reasons to be so strongly opposed to it; just as Eric Evans, whom Martin cites several times.