知识卡片
按业务需求选择实现
选择业务逻辑模式时,先问是否需要资金变化追踪、一致审计或深度行为分析,再问业务规则是否复杂,最后问数据结构是否复杂。对应起点分别是事件溯源领域模型、领域模型、活动记录、事务脚本。这是选择复杂工具所需收益的检查,不代表任何涉及金额的简单模块都必须机械升级。
结构图:
flowchart TD
A{追踪资金或需审计深度分析} -->|是| B[事件溯源领域模型]
A -->|否| C{业务规则复杂}
C -->|是| D[领域模型]
C -->|否| E{数据结构复杂}
E -->|是| F[活动记录]
E -->|否| G[事务脚本]
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 设计启发式 · 查看原书依据
With all of this in mind, an effective heuristic for choosing the appropriate business logic implementation pattern is to ask the following questions: Does the subdomain track money or other monetary transactions or have to provide a consistent audit log, or is deep analysis of its behavior required by the business? If so, use the
参考来源
- 位置:《Learning Domain-Driven Design》第10章《设计启发式》(来源项目:book-sources;源文件:extracted/Learning Domain-Driven Design/_epub-src/OEBPS/ch10.html)
- 结论依据:原文围绕本卡所述机制给出定义、适用条件及相关取舍,以下摘录为直接依据。
- 原始内容:With all of this in mind, an effective heuristic for choosing the appropriate business logic implementation pattern is to ask the following questions: Does the subdomain track money or other monetary transactions or have to provide a consistent audit log, or is deep analysis of its behavior required by the business? If so, use the