知识卡片
模型设计代码协同迭代
让模型驱动实现,需要反复比较领域表达与代码可行性:
- 让一部分设计直接体现模型概念,使映射清晰。
- 从模型提取设计术语与职责分配,并写入代码。
- 遇到实现别扭或领域含义失真时,连同模型、设计和代码一起修订。
代码改动也可能改变模型,应同步检查需求和团队语言。这个循环不是把任意分析图直接翻译成代码。参见 [[模型驱动设计兼顾分析与实现]]。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 原书第03章|A Medieval Sky Computer · 查看原书依据
Draw from the model the terminology used in the design and the basic assignment of responsibilities. The code becomes an expression of the model, so a change to the code may be a change to the model.
参考来源
- 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第24章《原书第03章|A Medieval Sky Computer》(源文件:_epub-src/0321125215_ch03lev1sec1_split_001.html)
- 结论依据:原文要求局部设计直接映射模型,随实现和领域认识修订模型,从模型取得术语与职责;代码改变可能牵动模型及项目其他活动。
- 原始内容:Design a portion of the software system to reflect the domain model in a very literal way, so that mapping is obvious. Revisit the model and modify it to be implemented more naturally in software ... Draw from the model the terminology used in the design and the basic assignment of responsibilities. The code becomes an expression of the model, so a change to the code may be a change to the model.