知识卡片
模块应随领域理解重构
模块不是项目初期定下就不再改变的目录。对象及领域认识变化后,旧模块边界可能反过来限制对象演化,形成耦合与重构阻力。发现理解困难或跨模块改动频繁时,应根据实际痛点重新组织概念和代码;同时考虑大范围引用修改、工具与团队沟通成本。原书以 Java 的包导入约定说明可以减少改名负担,但具体语法只是当时的技术示例。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 原书第05章|Modules (a.k.a. Packages) · 查看原书依据
MODULES and the smaller elements should coevolve, but typically they do not. MODULES are chosen to organize an early form of the objects. After that, the objects tend to change in ways that keep them in the bounds of the existing MODULE definition.
参考来源
- 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第41章《原书第05章|Modules (a.k.a. Packages)》(源文件:_epub-src/0321125215_ch05lev1sec5.html)
- 结论依据:原文指出模块往往停留在早期模型,重构成本导致惯性,并要求依据实际问题重新组织;Java 导入是说明降低修改成本的示例。
- 原始内容:M ODULES and the smaller elements should coevolve, but typically they do not. M ODULES are chosen to organize an early form of the objects. After that, the objects tend to change in ways that keep them in the bounds of the existing MODULE definition. ... It can only be overcome by biting the bullet and reorganizing MODULES based on experience of where the trouble spots lie.