命名:围绕瘦 API 的富 API 会被称为什么
我有一个“瘦”(SOAP)API,它只知道如何在底层系统中设置和获取实体。
我即将创建一个“丰富”API,它封装“瘦”API 并实现复杂操作所需的逻辑,这些操作需要按特定顺序获取和设置多个实体。
示例:丰富的 API 将负责通过创建通过精简 API 链接到“帐户”实体的“潜在客户”实体来创建新的用户帐户。
我陷入了命名困境,所以我求助于 SO;)您会给我丰富的 API 起什么名字? “xxxRichAPI”? “xxx助手”? “xxx服务”?
I have a "thin" (SOAP) API that only knows how to set and get entities in the underlying system.
I am about to to create a "rich" API that encapsulates the "thin" API and implements the logic that is required for complex operations that entail getting and setting several entities in specific order.
Example: The rich API will be responsible for creating a new user account by creating a "Lead" entity that's linked to an "Account" entity via the thin API.
I'm stuck in a naming block so I turn to SO ;) What name would you give my rich API? "xxxRichAPI"? "xxxHelper"? "xxxService"?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
API 的重点不就是隐藏它的实现吗? 因此,您的 API 调用更精简的 API 这一事实是无关紧要的。 根据 API 的用途适当地命名您的 API,无论它是如何工作的。
Isn't the point of an API that it hides it's implementation? As such, the fact that your API calls a thinner API is irrelevant. Name your API appropriately for what it does, regardless of how it does it.
乍一看,这听起来像 GoF Facade 模式。 您可能会考虑使用名称“xxxFacade”。
At first glance, this sounds like the GoF Facade pattern to me. You might considering using the name "xxxFacade".