知识卡片
转账规则归领域层
在原书的简化网银转账例子中,界面接收账户和金额,应用层协调转账任务,领域层负责“每笔贷记都有对应借记”的根本业务规则,基础设施处理事务和持久化。即使请求入口从界面换成 XML 消息,下层业务职责也不应随之改变。图4.1是说明分层的教学示例,省略安全等重要技术问题,并非可直接采用的银行系统设计。参见[[四层架构按职责隔离]]。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 原书第04章|Layered Architecture · 查看原书依据
Note that the domain layer, not the application layer, is responsible for fundamental business rulesin this case, the rule is "Every credit has a matching debit.
参考来源
- 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第30章《原书第04章|Layered Architecture》(源文件:_epub-src/0321125215_ch04lev1sec1.html;图4.1:04fig01.gif)
- 结论依据:原文转账例子和图4.1将业务配平规则置于领域层,并明确声明省略安全、简化领域与基础设施;替换输入渠道不应影响应用及更低层。
- 原始内容:Note that the domain layer, not the application layer , is responsible for fundamental business rulesin this case, the rule is "Every credit has a matching debit." ... But that user interface could be replaced by a wire request in XML without affecting the application layer or any of the lower layers.