Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Domain Driven Design vs Model Driven Architecture

I am curious, what are the differences between Domain Driven Design and Model Driven Architecture? I have the impression they have certain similarities.

Could you enlighten me?

Thanks

like image 957
DaJackal Avatar asked Nov 12 '10 16:11

DaJackal


People also ask

Is Domain-Driven Design an architecture?

In domain-driven design, the domain layer is one of the common layers in an object-oriented multilayered architecture.

Is MVC a Domain-Driven Design?

Domain-driven design separates the model layer “M” of MVC into an application, domain and infrastructure layer. The infrastructure layer is used to retrieve and store data. The domain layer is where the business knowledge or expertise is.

What is a model Domain-Driven Design?

Domain-Driven Design(DDD) is a collection of principles and patterns that help developers craft elegant object systems. Properly applied it can lead to software abstractions called domain models. These models encapsulate complex business logic, closing the gap between business reality and code.


2 Answers

Don't disagree with most of the above although it's perhaps worth expanding a little.

The single most important concept in DDD is to focus on the problem domain. To put technology obsession to the side and concentrate primarily on modelling the problem you're trying to solve. So put ajax, ORMs, databases, frameworks etc. into the background and instead make sure you have a complete, accurate model of the problem first and foremost. (Of course you still need the architectural components - but they're explicitly subservient to the model). DDD calls this "Ubiquitous Language" - a model expressed in terms domain experts and developers alike use and understand. A model where the names of classes, methods etc. are taken from the problem domain.

DDD doesn't mandate /how/ you capture that model, although the book implies using an OO language to do so.

MDA shares that same notion of modelling the problem domain first and foremost (the PIM, Platform-Independent Model). As opposed to DDD, it recommends creating that model with UML. But the intent is the same: understand the problem domain without tainting it with (software) architectural concerns.

MDA's PSM (Platform-Specific Model) is somewhat analogous to applying the architectural patterns in DDD (e.g. aggregate, repository, etc.). Again - while different in specifics - both aim to solve the problem of converting a 'pure' problem domain model into a full software system.

So summing up, I'd say they are similar in two ways:

  1. The centrality of the Model (as @Rui says) - specifically the /Domain/ model.
  2. Applying architectural patterns to the model in order to realise the target system.

hth.

like image 142
sfinnie Avatar answered Sep 21 '22 08:09

sfinnie


The root of both Domain-Driven Design (DDD) and Model Driven Architecture (MDA) is Model-Driven Engineering(MDE), also known as Model-Driven Software Development (MDSD) if limited to the software development domain. See Wikipedia: http://en.wikipedia.org/wiki/Model-driven_development

All approaches falling under the MDE umbrella have one thing in common: a model. How this model is materialized depends on the specific MDE flavor.

MDA is regarded as overly complex. DDD is considered by some as too abstract. My personal favorite MDE implementations are DSM and ABSE (not listed on the Wikipedia article).

like image 40
Rui Curado Avatar answered Sep 20 '22 08:09

Rui Curado