知识卡片

普通读书笔记卡 · 1845.g

严格与宽松契约的边界

理解等级:高级

严格契约规定字段名、类型、顺序等细节,便于构建时校验和精确文档,也往往需要版本管理;频繁变化时可能迫使多方同步升级。宽松的名值对减少实现约束、便于独立演进,但拼写、遗漏和类型错误要靠额外验证捕获,语义变化仍需协商。协议名不直接决定严格度:JSON可叠加schema成为严格契约。版本支持过多且缺乏废弃策略也会制造集成负担。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 契约 · 查看原书依据

      A strict contract requires adherence to names, types, ordering, and all other details, leaving no ambiguity. An example of the strictest possible contract in software is a remote method call, using a platform mechanism such as RMI in Java. In that case, the remote call mimics an internal method call, matching name, parameters, types, and all other details.

    参考来源

    - 位置:《Software Architecture The Hard Parts Modern Trade-Off Analyses for Distributed Architectures (Neal Ford, Mark Richards, Pramod Sadalage etc.)》第13章《Chapter 13. Contracts》(来源项目:book-sources;源文件:extracted/Software Architecture The Hard Parts Modern Trade-Off Analyses for Distributed Architectures (Neal Ford, Mark Richards, Pramod Sadalage etc.)/_epub-src/OEBPS/ch13.xhtml) - 结论依据:原文的定义、示例或失败路径支持以下归纳:严格契约规定字段名、类型、顺序等细节,便于构建时校验和精确文档,也往往需要版本管理;频繁变化时可能迫使多方同步升级。 其他条件结合本章同小节说明;不将模式目标当成已有运行保证。 - 原始内容:A strict contract requires adherence to names, types, ordering, and all other details, leaving no ambiguity. An example of the strictest possible contract in software is a remote method call, using a platform mechanism such as RMI in Java. In that case, the remote call mimics an internal method call, matching name, parameters, types, and all other details.