Skip to content

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

Latest articles

10 min read

Why Business Logic Should Stay Out of Services: Moving from Anemic to Rich Domain Model

The article compares anemic and rich domain models using an order‑cancellation case, showing how setters and magic numbers in services lead to rule violations, and walks through a step‑by‑step refactor that moves business rules into the domain object for better encapsulation and consistency.

6 min read

How Rich Models Supercharge DDD Entity Design and Boost Maintainability

Rich (or active) models embed behavior and aggregation relationships directly within DDD entities, contrasting with anemic models; this approach clarifies business logic, reduces glue code, and improves readability, though it can cause entity bloat, prompting strategies like external service classes, utility helpers, and careful injection handling.

8 min read

Why the Anemic Domain Model Is a Hidden Anti‑Pattern and How Rich Models Save You

This article examines the anemic (transaction‑script) versus rich (active) domain model patterns, explaining their origins, drawbacks, and benefits, and shows why embedding behavior in domain objects aligns with true object‑oriented design while over‑reliance on service layers leads to costly anti‑patterns.

8 min read

Anemic vs. Rich Domain Model: Core Concepts and Trade‑offs in Domain‑Driven Design

The article explains the fundamental differences between the anemic (transaction‑script) and rich (domain‑model) approaches in DDD, discusses their historical origins, advantages, disadvantages, and provides concrete examples to help developers decide when to apply each model in software architecture.