知识卡片

普通读书笔记卡 · 3447.a

API设计纳入消费者

理解等级:中级

API 是供他人调用的界面。设计前应了解客户端需要完成的任务,并让 API 消费者参与评估;先写好接口文档再实现,有助于减少双方对请求和响应的误解。只让服务端团队单独定义“方便实现”的接口,可能把复杂度转移给调用方。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    原书出处

    参考来源

    - 位置:《Microservice APIs》第 1 章《What are microservice APIs?》(源文件:_epub-src/OEBPS/Text/01.htm) - 结论依据:1.4 节把 API 设计与 UI 设计类比,明确要求设计前满足客户端需求并让 API 消费者参与,且把良好设计和文档分别联系到开发者体验与集成可靠性。 - 原始内容:We build APIs for others to consume, so before we build the API, we must produce an API design that meets the needs of our API clients. Just as we involve users when we design an application’s user interface (UI), we must also engage with our API consumers when we design the API. Good API design delivers good developer experience, while good API documentation helps to deliver successful API integrations.