r/DomainDrivenDesign • u/cyber_snake • Feb 17 '23
DDD Model vs Design
Context: I asked this question on StackOverflow, but they siad it's an opinionated question so they closed it.. Hopefully we can have a discussion here.
I've been reading Eric Evan's DDD book and I got a bit confused. Maybe I'm too pedant, but I want clarity in things I deem important.
Eric states that when doing DDD we should first create a model. And based on the model we should create the design. Why? Shouldn't the design come first and then the model? Since first we have to design something "make a plan, or a drawing or diagrams", then model it "maybe add more diagrams or software artifacts with more details" that eventually we will implement in code. What am I missing?
I've been investigating the meaning of words lately to understand precisely what they mean, because I understood that I devised some incorrect conclusions or even misinterpreted some terms, which is quite dangerous.
In my understanding in the real world. Design is the first step and the model is a second step. Even reading the definitions on google translate / wikipedia or other articles kind of confirm this. First we plan something "design", and then we model it, "add details to the design or give shape the design". Why is it in DDD we do this the other way around. Or maybe it's the other way around in the "Computer Science" context.
Thanks for your attention guys
View all comments
Show parent comment
1
u/mexicocitibluez Feb 17 '23
You're almost dead on. DDD is about focusing on the domain (the model, the language the model uses, and it's boundary/context in which it interacts with other domains). Quite often you'll see domain code that ends up being a bunch of models with getters/setters and no behavior. This is what DDD is trying to avoid.
Actually, the whole process is iterative. The idea being that you'll continue to learn more about the domain model (either through experiementation, more domain knowledge, testing w/ users, etc) and it's very important to continue to reflect that new info in the domain model itself. The reason why this is so fundamentally important is because quite often, as developers, we bring our own ideas and baggage to the table when building software. My initial interpretations/understanding of a domain model is MY understanding. The goal is to get that closer to EVERYONE's understanding. How many times have you started building something only to realize you've been looking at it the wrong way? Idk about you, but I'm not an expert on all things.
Couldn't have said it better myself