知识卡片
单一职责按变化原因划分
单一职责让模块围绕一个变化原因组织。支付规则与存储适配分开可减少模式变更对业务判断的侵扰,但支付成功仍取决于必须的持久化与事务结果。原书“数据库失败不阻塞核心交易”不能作为通用结论;职责分离不等于忽略落账失败。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Design for Speed and Efficiency · 查看原书依据
The Single Responsibility Principle (SRP) states that a class or module should have only one reason to change. In serverless architectures, this principle applies to individual functions or microservices, where each should encapsulate a single, well-defined task.
参考来源
- 位置:《Building Distributed Systems Designing scalable architectures with microservices, event-driven patterns, and robust deployment…》第05章《Design for Speed and Efficiency》(来源项目book-sources;源文件:extracted/Building Distributed Systems Designing scalable architectures with microservices, event-driven patterns, and robust deployment…/_epub-src/OPS/ch05.xhtml)
- 结论依据:原文给出本卡对应定义或示例;单一职责让模块围绕一个变化原因组织。 对原文省略和过度承诺的限定是本卡显式纠正,不能反过来当作原书已证明。
- 原始内容:The Single Responsibility Principle (SRP) states that a class or module should have only one reason to change. In serverless architectures, this principle applies to individual functions or microservices, where each should encapsulate a single, well-defined task.