领域特定语言 (DSL) 和领域驱动设计 (DDD)

发布于 2024-07-06 02:26:40 字数 43 浏览 10 评论 0原文

领域特定语言(DSL)和领域驱动设计(DDD)之间有什么区别和相似之处?

What is the differences and similarities between Domain Specific Languages (DSL) and Domain Driven Design (DDD)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

抽个烟儿 2024-07-13 02:26:40

DDD 的一个要素可以被视为开发通用语言以与利益相关者讨论该领域的能力。 对于那些既明确又可能可执行的 UL 子集,您可以选择使用内部或外部 DSL 来实现它们。

这是我在 DomainDriven 网站上讨论此问题的视频:

http://domaindrivendesign.org/library/bell_gitlevich_2009

最美好的祝愿,
彼得

One element of DDD can be seen as the ability to develop Ubiquitous Languages for talking with stakeholder about the domain. For the subset of those UL's that are both unambiguous and potentially executable, you may choose to implement them using an internal or external DSL.

Here's a video of me discussing this on the DomainDriven site:

http://domaindrivendesign.org/library/bell_gitlevich_2009

Best Wishes,
Peter

青瓷清茶倾城歌 2024-07-13 02:26:40

维基百科对 DSL 有一个非常明确的定义:

术语特定领域语言
(DSL)最近开始流行
多年的软件开发经验
表示编程语言或
规范语言专用于
特定问题域,a
特定问题表示
技术和/或特定的
解决技术。

这可以实现为一组遵循某种一致模式的类、一些奇特的 C++ 模板魔法,或者解释自由文本输入以执行您想要的操作的编译器/解析器。

Wikipedia has a pretty clear definition for DSL:

The term domain-specific language
(DSL) has become popular in recent
years in software development to
indicate a programming language or
specification language dedicated to a
particular problem domain, a
particular problem representation
technique, and/or a particular
solution technique.

This can be implemented as a set of classes following some consistent pattern, some fancy C++ template magic, or a compiler/parser that interprets free text input to do what you want.

隔岸观火 2024-07-13 02:26:40

我认为它们在某种程度上是相关的(正如克里斯托夫所说),但却是两个完全不同的方面。 我什至不会驳回乔普的声明。

有关 DSL 的详细信息,请参阅 Martin Fowler 的 DSL 页面集(正在进行中),您可以从 示例定义。 另一本值得一读的文章是他的 QandA

DDD 基于领域模型,通常至少比 DSL 高一级抽象级别。 两者都可以独立存在,正如 Christophe 已经说过的,它们都可以在同一个项目中使用。

I think they are somehow related (as Christophe put it), but two totally different aspects. I wouldn't even dismiss jop's statement.

For very well written information on DSLs refer to Martin Fowler's set of pages on DSLs (work in progress), you may start with the example, or the definition. Another good read is his QandA.

DDD is based on the domain model and usually at least one abstraction level higher than the DSL. Both can exist without the other, and as Christophe already said, they can both be used in the same project.

神经大条 2024-07-13 02:26:40

区别在于,一个是使用领域特定语言 (DSL) 而不是通用语言来构建系统的方法,另一个是设计和构建系统的架构方法 (DDD)。

相似之处在于它们都专注于特定领域。

The differences, one is an approach to building systems using a Domain Specific Language language (DSL) instead of a General Purpose Language and the other is an architectural approach (DDD) to designing and building systems.

The similarity is that they both focus on the specific domain.

春庭雪 2024-07-13 02:26:40

维基百科(https://en.wikipedia.org/wiki/Domain-driven_design)有一个很好的答案:

DDD 并不特别要求使用 DSL,尽管它可能是
用于帮助定义 DSL 并支持特定领域等方法
多模型。

Wikipedia (https://en.wikipedia.org/wiki/Domain-driven_design) has a good answer:

DDD does not specifically require the use of a DSL, though it could be
used to help define a DSL and support methods like domain-specific
multimodeling.

嗳卜坏 2024-07-13 02:26:40

Markus Voelter 在他的 DSL Engineering 书 中提供了很好的答案2.5.2 思考和沟通工具

实际上,DSL 是以下形式的形式化
埃里克·埃文斯领域意义上的无处不在的语言
驱动设计。

Nice answer is provided by Markus Voelter in his DSL Engineering book, paragraph 2.5.2 A Thinking and Communication Tool:

In effect, a DSL is a formalization of
the Ubiquitous Language in the sense of Eric Evans’ Domain
Driven Design.

錯遇了你 2024-07-13 02:26:40

领域驱动设计(DDD)是一种思考和交流问题及其解决方案的方式。

领域特定语言(DSL)是一种编写代码的方式。

它们很相似,因为它们都以“域”一词开头。 我想就是这样。 :-)

Domain Driven Design (DDD) is a way of thinking and communicating about the problems and its solutions.

Domain Specific Language (DSL) is a way of writing code.

They're similar because they both start with the word "domain". That's it, I guess. :-)

不回头走下去 2024-07-13 02:26:40

领域驱动设计强调问题域在为所设计的系统创建基本词汇、概念和对象模型时的作用。

领域特定语言是一种用于指定或实现系统特定部分的符号,面向该领域从业者的需求(即最小化大多数编程或规范语言的“程序员语言”方面)。

Domain-Driven Design emphasizes the role of the problem domain as you create the fundamental vocabulary, concepts, and object model for the system being designed.

A Domain-Specific Language is a notation for specifying or implementing specific parts of the system, oriented to the needs of the practitioner in that domain (i.e. minimizing the "programmerese" aspects of most programming or specification languages).

蝶…霜飞 2024-07-13 02:26:40

我认为它们在某种程度上是相关的,而不仅仅是“域”这个词。 一旦你有了一个好的(领域驱动的)设计,它肯定会有助于创建一个可靠的 DSL。

“DDD 并不特别要求使用 DSL,尽管它可以用来帮助定义 DSL。” - 维基百科

I would argue that they are somehow related and not only by the word "domain". Once you have a good (domain-driven) design, it will surely help in creating a solid DSL.

"DDD does not specifically require the use of a DSL, though it could be used to help define a DSL." - Wikipedia

缘字诀 2024-07-13 02:26:40

我想两者的主要焦点都是减少编程中的噪音,DDD 作用于语义噪音,DSL 作用于句法噪音。

这些可能有助于理解我的观点:

http://fragmental.tw/2009/03 /12/expessive-design-slides/

http://fragmental.tw/2008/04/20/domain-specific-languages-and-video-games/

I guess both have as its main focus reducing the noise in programming, DDD acts on semantic noise and DSLs in syntactic noise.

These may help understand my opinion:

http://fragmental.tw/2009/03/12/expessive-design-slides/

http://fragmental.tw/2008/04/20/domain-specific-languages-and-video-games/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文