知识卡片

普通读书笔记卡 · 3287.b

门面与适配器职责不同

理解等级:中级

门面主要遮蔽后端结构并路由请求,适配器还需把请求转换成目标系统可理解的表示。把协议转换不断塞进网关会增加网关与服务的耦合;应明确转换责任、错误语义和退场方案。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      Facade and Adapter patterns are very similar, in the sense that they get in the way. A facade is usually less complex than an adapter; a traditional API gateway simply routes API requests, whereas an adapter will be responsible for converting into a representation understood by the target application.

    参考来源

    - 位置:《Mastering API Architecture》第8章《Redesigning Applications to API-Driven Architectures》之《Facade and Adapter》(源文件:_epub-src/OEBPS/ch08.xhtml) - 结论依据:原文比较门面路由与适配器表示转换,并提醒网关跨越职责界限会增加耦合。 - 原始内容:Facade and Adapter patterns are very similar, in the sense that they get in the way . A facade is usually less complex than an adapter; a traditional API gateway simply routes API requests, whereas an adapter will be responsible for converting into a representation understood by the target application.