在领域驱动设计 (DDD) 中,如何记录和记录模型
在领域驱动设计中,如何记录模型的关键方面,以便与您的团队进行沟通并随着时间的推移进行开发?
我所说的关键方面是指:
无处不在的语言 聚合根 实体/值对象 不变量
In Domain Driven Design how do you document key aspects of your model so that it can be communicated with your team and so that it can be developed over time?
By Key Aspects I mean:
ubiquitous language
aggregate roots
Entities / Value Object
Invariants
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在代码中。并且在谈话中。在白板、文档和模型上……
关键点是(1)普遍性和(2)一致性。因此,如果领域专家谈论“评估贷款申请”,您应该拥有在语法和语义上与该概念相匹配的代码。所以你可能有
LoanApplication.Assess()
。您不会有ApplicationManager.QualifyApplication()
或类似的。因此,您至少需要在代码中记录该语言。您还可以选择记录在文档和/或图表中。您还将在白板和讨论中使用。但在所有情况下都是同一种语言。
嗯。
In the code. And in conversations. And on whiteboards, and documents, and models...
The key points are (1) ubiquity and (2) consistency. So if a domain expert talks about "Assessing a Loan Application", you should have code that syntactically and semantically matches that concept. So you might have
LoanApplication.Assess()
. You wouldn't haveApplicationManager.QualifyApplication()
or similar.So you would minimally record the language in the code. You may also choose to record in documentation and/or diagrams. You will also use on whiteboards and in discussions. But in all cases it's the same language.
hth.