知识卡片
能力需要经接口暴露
组件内部已有功能,不代表其他组件能直接使用;外部调用还需要明确的接口和权限边界。新增需求时先判断现有能力应由原服务暴露,还是迁到别处,避免前端绕过服务直接碰数据库。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
原书出处
参考来源
- 位置:《Principles of Software Architecture Modernization》第2章《Anti-Patterns: Lack of Isolation》(源文件:`_epub-src/OPS/ch02.xhtml`,归一化正文 [8328:12568))
- 结论依据:原文中的 Profile 服务虽已有生成报告的能力,但因未暴露该能力,BFF 无法调用;这说明内部实现与外部契约的区别。
- 原始内容:No entity outside the profile service can invoke the capability, even with the code present, because it is not exposed. It was only possible for the BFF to fetch the user profile from the Profile service because the service exposed an API; a REST API returning JSON.