知识卡片
以语义代理接入旧服务
现有服务无法改造时,可新增符合本生态协议、表示及词汇的代理接口,内部把请求与响应翻译到旧服务。COP适合少量特定能力,例如HTTP上传转FTP;ELP面向一组既有平台作通用转换;SPP重点弥合格式及词汇差异。
代理同样需要profile、服务定义及动作实现。格式转换未必等于语义转换,补表单与映射业务词汇更难,SPP尤其受模糊术语影响。翻译增加延迟和维护成本,不能默认适合高吞吐低延迟链路;优先限定词汇与功能范围。
关联:[[动作契约遮蔽内部流程]]、[[词汇描述覆盖数据与动作]]。
结构图:
flowchart LR
A[消费者按本地词汇请求] --> B[合规代理接口]
B -->|翻译协议和输入| C[旧服务]
C -->|旧格式响应| B
B -->|映射词汇并补超媒体控制| A
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 超媒体服务 · 查看原书依据
There are times when we need the functionality of an existing service, but the service design was not meant to support adaptable, evolvable interfaces in a RESTful ecosystem. In these cases, we need to create local, compliant service proxies that act as “translation” devices between those noncompliant services and the rest of our service ecosystem.
参考来源
- 位置:《RESTful Web API Patterns and Practices Cookbook》第5章《Hypermedia Services》(来源项目book-sources:extracted/RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)/_epub-src/OEBPS/ch05.xhtml,配方5.17)
- 结论依据:原文区分ELP、COP、SPP及FTP上传、格式转换与词汇转换的成本,说明代理仍需完整接口设计。
- 原始内容:There are times when we need the functionality of an existing service, but the service design was not meant to support adaptable, evolvable interfaces in a RESTful ecosystem. In these cases, we need to create local, compliant service proxies that act as “translation” devices between those noncompliant services and the rest of our service ecosystem.