this post was submitted on 03 Nov 2023
4 points (83.3% liked)

Domain-Driven Design

248 readers
14 users here now

"Domain-Driven Design is an approach to software development that centers the development on programming a domain model that has a rich understanding of the processes and rules of a domain. The name comes from a 2003 book by Eric Evans that describes the approach through a catalog of patterns. Since then a community of practitioners have further developed the ideas, spawning various other books and training courses. The approach is particularly suited to complex domains, where a lot of often-messy logic needs to be organized." -- Martin Fowler (link)

Rules

  1. Follow programming.dev rules
  2. Be excellent to each other, no hostility towards users for any reason
  3. No spam of tools/companies/advertisements. It’s OK to post your own stuff part of the time, but the primary use of the community should not be self-promotion.

founded 1 year ago
MODERATORS
 

Anyone preaches the virtues and advantages of domain-driven design, its positive impact on maintainability and adding features, and how it improves developer experience. However, as all things in life, all roses have their thorns.

Has anyone had any negative experience caused directly or indirectly by domain-driven design? This might be a botched migration, problems during the requirements gathering stage, domain models ending up being too rigid/too permissive for an application, etc.

all 3 comments
sorted by: hot top controversial new old
[–] douglasg14b@programming.dev 4 points 1 year ago* (last edited 1 year ago) (1 children)

Like most large conceptual practices the pain comes when it misused, mismanaged, and misunderstood.

DDD like Agile, when applied as intended, adds more to success than it detracts. This means that others take it and try to use it as a panacea, and inappropriately apply their limited and misunderstood bastardization of it, having the opposite effect.

Which leads to devs incorrectly associating these concepts & processes to the pain they have, instead of recognizing a bad implementation as a bad implementation.

Personally, I've found great success by applying DDD where necessary and as needed, modifying it to best fit my needs. (Emphasis mine). I write code with fewer bugs, which is more easily understood, that enforces patterns & separations that improve productivity, faster than I ever have before. This is not because I "went DDD", it's because I bought the blue book, read it, and then cherry picked out the parts that work well for my use cases.

And that's the crux of it. Every team, every application, every job is different. And that difference requires a modified approach that takes DevX & ergonomics into consideration. There is no one-size-fits-all solution, it ALWAYS needs to be picked at and adjusted.


To answer your question

Yes, I have had lots of pain from DDD. However, following the principals of pain driven development, when that pain arises we reflect, and then change our approach to reduce or eliminate that pain.

Pain is unavoidable, it's how you deal with it that matters. Do you double down and make it worse, or do you stop, reflect, fix the pain, refactor, and move on with an improved and more enlightened process?

It's literally just "agile", but for developer experience.

[–] lysdexic@programming.dev 1 points 1 year ago

Yes, I have had lots of pain from DDD. However, following the principals of pain driven development, when that pain arises we reflect, and then change our approach to reduce or eliminate that pain.

I was hoping that this discussion would lead to people sharing their personal experience to allow others to benefit from that reflection.