知识卡片
服务客户端应保持精简
服务客户端可以复用序列化、端点映射和调用样板,但它本身仍是库。由服务所有者维护客户端时,应尽量少带依赖,并把兼容性责任留在服务公开契约上,避免客户端版本再次绑定所有消费者。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
原书出处
参考来源
- 位置:《Principles of Software Architecture Modernization》第4章《Anti-Patterns: Internal Shared Libraries》(源文件:`_epub-src/OPS/ch04.xhtml`,归一化正文 [29459:33672))
- 结论依据:原文认可服务客户端减少重复工作,同时明确它们仍是库,必须谨慎选择依赖,否则会产生二进制耦合。
- 原始内容:A driver/client can be great. Service owners should create drivers. However, drivers are libraries, and libraries need to be lean. A driver should pick dependencies very carefully because it is a source of binary coupling. Otherwise, drivers can suffer from all the problems mentioned in this chapter.