domain-driven-design - 自下而上的方法有什么问题

标签 domain-driven-design bottom-up

我无法清楚地理解 领域驱动设计 提倡的自下而上 方法的问题。有人可以简单地写一下或在写作方向上轻推我吗? 我的意思是,在 Sql 世界中,我们有表表示的实体,它们有关系、约束等。那么现在 DDD 提出的将类作为实体开始的新方法将如何使我们受益?但在此之前,如问题所示,我需要了解自下而上方法带来的问题。

最佳答案

SapiensWorks Mike 解释得很好:

The Domain should not be tainted with infrastructure details. If you start with the db (botton up approach), everything will evolve around it and will be constrained by it. But you don't build the application for the database, you build it for the Domain, the database is just a Persistence implementation detail.

The domain is the reason the application exists and everything should gravitates around it. The domain should not depend on anything, especially not on a persistence implementation details. When you design the Domain Entities, they should don't know anything about persistence.

我建议您先阅读完整的帖子,然后再继续阅读此处。

如果您首先设计持久性模式,您就不会考虑域;至少,不完全而且需要很深。您正在设计效率、冗余、规范化、关系等而不是行为,稍后您将创建适合该持久性方案的实体。突然间,您会发现在您的实体中所做的毫无意义、奇怪和奇怪的事情只是为了匹配持久性模式、持久性实现和/或持久性技术,除非您进行持久性重新设计的迭代。

为适应持久性和持久性重新设计迭代而设计的实体这两种方法都很糟糕。第一个因为不好的实体设计和SOLID休息;第二个是因为这是额外的工作和浪费时间。

How is the new approach of starting with classes as entities as proposed by DDD will benifit us?

良好的实体设计(这意味着良好的域建模)和/或不在持久性设计迭代中浪费时间。

关于domain-driven-design - 自下而上的方法有什么问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35169287/

相关文章:

c# - 基于图形的应用程序的域服务和应用程序服务

python - DDD 与 Python : did I get it right?

python - heapify的O(n)算法

python - 使用递归动态规划时如何填充背包表

java - 动态规划最长递增子序列

java - DDD 聚合 ID 和外键

c# - SOA、TDD、DI 和 DDD - 一个 shell 游戏?

c# - NCommon 的任何替代品?

text - 添加新文本时,它出现在底部,其余文本上升

android - 如何在 Android 中为我的 ListView 设置从下到上的链接按钮?