域驱动设计与模型驱动架构 [英] Domain Driven Design vs Model Driven Architecture

查看:76
本文介绍了域驱动设计与模型驱动架构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很好奇,领域驱动设计和模型驱动体系结构之间有什么区别?我觉得它们有某些相似之处.

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

你能启发我吗?

谢谢

推荐答案

尽管可能值得扩展一点,但不要反对以上大部分内容.

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

DDD中最重要的一个概念是关注问题域.为了消除技术困扰,主要集中于对您要解决的问题进行建模.因此,将ajax,ORM,数据库,框架等置于后台,而首先要确保您具有完整,准确的问题模型. (当然,您仍然需要架构组件-但它们明确地服从于模型). DDD将此称为无处不在的语言"-用领域专家和开发人员都在使用和理解的术语表达的模型.从问题域中获取类,方法等名称的模型.

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并没有强制/如何/捕获该模型,尽管该书暗示要使用OO语言来做到这一点.

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

MDA最先具有相同的概念,即对问题域进行建模(PIM,与平台无关的模型).与DDD相反,它建议使用UML创建该模型.但是目的是相同的:了解问题域而不用(软件)体系结构问题来困扰它.

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的PSM(特定于平台的模型)有点类似于在DDD中应用架构模式(例如,聚合,存储库等).再次-尽管细节不同-两者都旨在解决将纯"问题域模型转换为完整软件系统的问题.

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. 模型的中心性(如@Rui所说)-特别是/Domain/模型.
  2. 将架构模式应用于模型以实现目标系统.

hth.

这篇关于域驱动设计与模型驱动架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆