知识卡片
宽容接收有明确范围
接口接收方可忽略自己不需要的额外字段,发送方只发送必要信息,从而减少无关数据造成的耦合。此处“宽容”不授权接受无效或危险输入;必需语义和安全验证仍须严格。破坏已有契约时,应通过版本与消费者测试协调。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Building Evolvable Architectures · 查看原书依据
You can accept more information than you consume. You don’t need to consume more information than necessary, even if there is additional data available. If you only want a phone number, don’t build a protocol for the entire address, only validate the phone number. This decouples a service from information/coupling points that it doesn’t need.
参考来源
- 位置:《Building Evolutionary Architectures Automated Software Governance, 2nd Edition》第07章《Building Evolvable Architectures》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Building Evolutionary Architectures Automated Software Governance, 2nd Edition/_epub-src/OEBPS/ch07.html;段落定位:You can accept more information than you consume)
- 结论依据:原文对“宽容接收有明确范围”的定义或案例,支撑“接口接收方可忽略自己不需要的额外字段,发送方只发送必要信息,从而减少无关数据造成的耦合”的归纳。据其上下文,此处“宽容”不授权接受无效或危险输入;必需语义和安全验证仍须严格。
- 原始内容:You can accept more information than you consume. You don’t need to consume more information than necessary, even if there is additional data available. If you only want a phone number, don’t build a protocol for the entire address, only validate the phone number. This decouples a service from information/coupling points that it doesn’t need.