知识卡片
持续重构依赖设计判断
先做当前可行的简单设计,再通过小步重构改善它,前提是团队能判断哪些结构值得保留或改变。重构本身是一连串重新设计;若只追求眼前代码最少,却缺少领域和设计判断,代码可能越来越难理解,后续修改也更费力。反过来,既有设计选择也会影响重构难度。因此,“避免过度设计”不能解释为“不深入思考设计”;应在真实反馈到来时调整设计深度。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Design Versus Development Process · 查看原书依据
Continuous refactoring is a series of small redesigns; developers without solid design principles will produce a code base that is hard to understand or change
参考来源
- 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第05章《Design Versus Development Process》(源文件:_epub-src/0321125215_fm01lev1sec3.html)
- 结论依据:原文先述 XP 以简单方案和持续重构应对变化,随后警告无设计原则的重构会产生难以理解或修改的代码,并指出既有设计选择会改变重构难度;卡片据此给出边界。
- 原始内容:Continuous refactoring is a series of small redesigns; developers without solid design principles will produce a code base that is hard to understand or change ... But past design choices make refactoring itself either easier or harder.