Modeling with Domain Driven Design and C4Model

Architecturedesigndomain-driven-design

I am wondering how DDD and C4Model can play together.

Level 1 of Simon Brown's c4 Model is System Context diagram. So I think after you find and define your Bounded Contexts, you may start creating adding diagrams using C4Model.

  • What is the context means on C4Model?

  • Or c4Model is not for DDD it has its own way of thinking? if yes then
    how C4Model works with Events?

  • Basically, my question is when do i use c4Model?

Best Answer

Actually, this is what I am thinking on and searching for an answer at the moment, which led me here.

So, answering your questions as I understand the topic at the moment:

What is the context means on C4Model?

Well, it's a context that your system is working in - an environment, external systems and people interacting with your system, according to C4 page.

Scope: A single software system.

Primary elements: The software system in scope.
Supporting elements: People and software systems directly connected to the software system in scope.

Intended audience: Everybody, both technical and non-technical people, inside and outside of the software development team.

Next:

Or c4Model is not for DDD it has its own way of thinking?

I think they are meeting together at some level. With DDD you create models, organized by Bounded Contexts, which are visualized on Context Map. Bounded Contexts can exist in the same physical location (Monolith) or can be implemented as separate things (Microservices), but this might not be shown on the Context Map.

C4 adds this physical dimension to DDD diagrams, showing external systems (context level) and physically deployed units (containers).

if yes then how C4Model works with Events?

Don't understand what you meant.

Basically, my question is when do i use c4Model?

In my opinion, when you want to design or document an architecture on different levels.

You can use both DDD and C4 together. For me they give different views on the same thing (the system you design), which can provide valuable insights.

Related Topic