知识卡片
先抽出局部子域再深化设计
大型系统难以一次整体改成柔性设计。先挑一个足以产生明显收益的局部子域:若一组操作像专门的数学,抽出计算模型;若状态变更受复杂规则约束,抽出可声明规则的模型或小框架。这样既能单独打磨新模块,也让留下的系统更小、更易理解。
选择目标要看领域中能形成完整概念的边界,避免把精力平均摊在整个系统。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 原书第10章|Angles of Attack · 查看原书依据
You may see a part of the model that can be viewed as specialized math; separate that. Your application enforces complex rules restricting state changes; pull this out into a separate model or simple framework that lets you declare the rules. With each such step, not only is the new module clean, but also the part left behind is smaller and clearer.
参考来源
- 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第82章《Angles of Attack》(源文件:_epub-src/0321125215_ch10lev1sec9.html;单元01)
- 结论依据:原文建议按可独立处理的专门数学或规则子域分步拆出模块,说明新模块与剩余部分都会更清晰,并主张集中改进一个区域。
- 原始内容:You may see a part of the model that can be viewed as specialized math; separate that. Your application enforces complex rules restricting state changes; pull this out into a separate model or simple framework that lets you declare the rules. With each such step, not only is the new module clean, but also the part left behind is smaller and clearer.