知识卡片
合取叶集可判定规格涵盖
对只用 AND 拼接、且叶规格按同一语义比较的情形,涵盖可以化为集合检查:新规格的条件叶集若包含旧规格全部条件,就有 new ⇒ old。例如旧为 {通风},新为 {通风, 防爆},新更严;年龄下限也是原书的特例:18岁门槛涵盖16岁门槛。
这个简化依赖条件成立:参数化叶规格可能需自定义比较;加入 OR 或 NOT 后,逻辑蕴含证明更复杂。若业务不需要两者兼得,可以只保留所需操作或放弃通用涵盖,避免把集合包含误当普遍算法。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 原书第10章|A Declarative Style of Design · 查看原书依据
So if the Composite Specification is able to collect all the leaf SPECIFICATIONS that are "ANDed" together, then all we have to do is check that the subsuming SPECIFICATION has all the leaves that the subsumed one has, and maybe some extra ones as wellits leaves are a superset of the other SPEC's set of leaves.
参考来源
- 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第81章《A Declarative Style of Design》(源文件:_epub-src/0321125215_ch10lev1sec8.html;单元04)
- 结论依据:原文把纯 AND 的复合规格涵盖转为叶条件超集检查,并指出参数化条件及 OR/NOT 会使证明复杂化。
- 原始内容:So if the Composite Specification is able to collect all the leaf SPECIFICATIONS that are "ANDed" together, then all we have to do is check that the subsuming SPECIFICATION has all the leaves that the subsumed one has, and maybe some extra ones as wellits leaves are a superset of the other SPEC 's set of leaves.