知识卡片
知识级配置变化仍要处理历史对象
知识级的间接性会增加理解成本。若规则本身过于复杂,配置者可能需要近乎程序员的技能,错误配置会使业务行为出错。规则变更也不会自动解决数据迁移:应谨慎分析既有操作级对象在新旧规则下如何处理,可能允许两套规则并存,也可能需要转换。
因此只在可配置性确实重要且会扭曲普通模型的地方使用,并设计可理解、可校验的约束。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 原书第16章|Knowledge Level · 查看原书依据
Like all powerful ideas, REFLECTION and KNOWLEDGE LEVELS can be intoxicating. This pattern should be used sparingly. It can unravel complexity by freeing operations objects from the need to be jacks-of-all-trades, but the indirection it introduces does add some of that obscurity back in. If the KNOWLEDGE LEVEL becomes complex, the system's behavior becomes hard to understand for developers and users alike. The users (or superuser) who configure it will end up needing the skills of a programmerand a meta-level programmer at that. If they make mistakes, the application will behave incorrectly. Also, the basic problems of data migration don't completely disappear. When a structure in the KNOWLEDGE LEVEL is changed, existing operations-level objects have to be dealt with. It may be possible for old and new to coexist, but one way or another, careful analysis is needed.