Diagram: Employee module exposes salary to payroll and salary benchmarking modules.

Navigating Domain Corruption, Dependencies and Simplicity

Assuming we and our teams bought into domain-driven design, the next question is, how do we interact between modules? Giving access to domain entities sounds like a great idea, but it carries consequences. There is a good argument to be had for exposing entities. After all, we spend a lot of effort ensuring our code expresses our domain well. On top of that, we ensure data can’t get into an invalid state, and trying to do so returns a descriptive error....

February 25, 2024 · 6 min