知识卡片
重构针对错误关系动刀
定位反模式后,重构计划应明确改变哪种关系:断开或反向某依赖以消除环,把适当功能上移以解决父类依赖子类,把跨模块反复共享而未封装的秘密抽成独立抽象。不是对热点所有文件统一重写。具体结构诊断让团队能估工、验证变化,并向业务方说明为什么这些修改会减少后续维护。
[[热点由六种反模式定位]]指出错误关系,本卡把相应关系作为重构切入点。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 管理架构债 · 查看原书依据
If a clique exists, for example, a dependency needs to be removed or reversed, so as to break the cycle of dependencies. If unhealthy inheritance is present, some functionality needs to be moved, typically from a child class to a parent class.
参考来源
- 位置:《Software Architecture in Practice, 4th Edition》第23章《管理架构债》(来源项目:book-sources;源文件:extracted/Software Architecture in Practice, 4th Edition/_epub-src/ch23.html)
- 结论依据:原文解释定位反模式后,重构计划应明确改变哪种关系:断开或反向某依赖以消除环,把适当功能上移以解决父类依赖子类,把跨模块反复共享而未封装的秘密抽成独立抽象;本章后续机制、例子与条件共同限定本卡,原书经验数字和前景不视为当前实测或现状。
- 原始内容:If a clique exists, for example, a dependency needs to be removed or reversed, so as to break the cycle of dependencies. If unhealthy inheritance is present, some functionality needs to be moved, typically from a child class to a parent class.