1

I meet the word model multiple of times when reading DDD articles. But I don't find any good article explains this term. After reading many articles, I am still confused what it actually is when I apply DDD.

Could you give me a solid example of model in DDD?

3

3 Answers 3

7

The Domain Model is your organised and structured knowledge of the problem. The Domain Model should represent the vocabulary and key concepts of the problem domain and it should identify the relationships among all of the entities within the scope of the domain.

The Domain Model itself could be a diagram, code examples or even written documentation of the problem. The important thing is, the Domain Model should be accessible and understandable by everyone who is involved with the project.

The Domain Model should also define the vocabulary around the project and should act as a communication tool for everyone involved. The Ubiquitous Language is an extremely important concept in Domain Driven Design and so it should be directly derived from the Domain Model.

One of the downfalls of many software development projects is the misunderstanding of terms, objectives and proposed solutions that are scoped at the beginning of development.

The Domain Model should act as a clear depiction of the problem that is being solved and the proposed solution. It is extremely important that all stakeholders of the project contribute to the Domain Model so that everyone understands the key concepts and definitions of the vocabulary of the project and how the problem is being tackled and solved.

1
  • 2
    What about "model"? is it an interchange of "domain model"? Jul 21, 2021 at 7:51
1

A model is a simplification. It is an interpretation of reality that abstracts the aspects relevant to solving the problem at hand and ignores extraneous detail.

A model is a selectively simplified and consciously structured form of knowledge. An appropriate model makes sense of information and focuses it on a problem.

The model is distilled knowledge. The model is the team's agreed upon way of structuring domain knowledge and distinguishing the elements of most interest. A model captures how we choose to think about the domain as we select terms, break down concepts, and relate them.

One reason why you are having trouble finding good examples of models: models are things that live in people's heads.

You might try reviewing the domain code in dddsample-core, which started as a joint project by Eric Evans and Citerus, using the cargo shipping domain from the examples in the 2003 DDD book.

The code, of course, is the design - it's the expression of their "model" of cargo shipping expressed in software. So you can look in that code, and see the language of the processes of cargo shipping built into that code.

In other words, the code there is a reflection of the "domain model" - the conceptualization of the business of cargo shipping shared by that team.

0

This is the closest thing to an actual concrete "model" / "domain model" that I have (that I could quickly find).

For the record, I never sit down and think "okay, today I am going to do DDD"; instead I blend a DDD way of thinking with other techniques, depending on the situation. The example below was made using Sparx EA, and as far as Sparx EA is concerned it's a UML Use Case diagram - but to us it was simply a way of capturing the model / ideas.

The example below simply calls out a bunch of related concepts, and how they relate. I am using the UML aggregation symbol to show where one thing is composed of others.

This is not a "final" polished model, and I don't think we ever "finished" this diagram / model- but the concepts and substance is real.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.