知识卡片
按变化场景重分职责
拆模块应把独立职责分开,而非把代码行数平均切半;把反复共同变化却散在多处的职责归拢,可减少一次请求修改多个地方。先列可能变化场景:若只动模块局部,其他职责可移走;若总改多模块,相应职责可能应同归一处。拆开与合并都服务变化边界,而非服务数量目标。
相关:[[变化传播揭示内聚耦合]]。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 可修改性 · 查看原书依据
Splitting a module should not simply consist of placing half of the lines of code into each submodule; instead, it should sensibly and appropriately result in a series of submodules that are cohesive on their own.
参考来源
- 位置:《Software Architecture in Practice, 4th Edition》第8章《可修改性》(来源项目:book-sources;源文件:extracted/Software Architecture in Practice, 4th Edition/_epub-src/ch08.html)
- 结论依据:原文的定义、机制或比较支持“拆模块应把独立职责分开,而非把代码行数平均切半;把反复共同变化却散在多处的职责归拢,可减少一次请求修改多个地方”;正文保留其条件与取舍。
- 原始内容:Splitting a module should not simply consist of placing half of the lines of code into each submodule; instead, it should sensibly and appropriately result in a series of submodules that are cohesive on their own.