使用API​​的一切网络应用? [英] Web app using API for everything?

查看:109
本文介绍了使用API​​的一切网络应用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我即将开始规划我公司内部的项目管理工具。有一件事一直使我想是的API。

I'm about to start planning an internal project management tool for my company. One thing that has always led me wondering is APIs.

难道被看作是不好的做法/效率太低先创建一个API和使用这些API构建实际的站点呼叫,而不是实现它的两倍?

Would it be seen as bad practice / too inefficient to create a API first and build the actual site using those API calls rather than implement it twice?

让我知道你的想法!

推荐答案

我完全同意,发展一个API会给你一个分离的架构,我建议。

I completely agree that developing an API will give you a decoupled architecture, and I recommend that.

不过,我觉得你应该警告说,开发API首先会增加你的错API的风险(PM,顺便说一下,主要是关于减少项目风险)。您还将受到诱惑,镏金,可能会被闲置,浪费时间的API--程序功能。开发与应用相结合的API保证其正确服务于实际应用的或应用程序的需求。除非你是在准确性和您的需求的理解有信心,我建议在使用应用程序时编程API的一个特征。

However, I feel you should be warned that developing the API first increases your risk of developing the wrong API (PM, by the way, is largely about reducing project risk). You will also be tempted to gold-plate your API-- program features that may go unused, which wastes time. Developing the API in conjunction with the application guarantees that it correctly serves the actual application's or applications' needs. Unless you are confident in the accuracy of and your understanding of the requirements, I suggest programming the API one feature at a time with the application.

例如,当你开发应用程序和发现上,你需要做的API调用,创建一个接口(取决于技术),看起来完全像你需要什么precise点。您可以存根接口获取应用程序的运行,这是用于检查应用程序仍然在轨道用户期望一个伟大的工具。 (你希望它是这样工作的,对不对?)之后,就可以实现该接口。如果碰巧要求变更苦,你会不会花时间,现在已经过时建设基础设施。

For example, as you develop the application and discover the precise point at which you need to make an API call, create an interface (depending on the technology) that looks exactly like what you need. You can stub that interface to get the app to run, which is a great tool for checking that the app is still on track with user expectations. ("You want it to work like this, right?") Later, you can implement that interface. If by chance requirements suffer alteration, you won't have spent time building now obsolete infrastructure.

这篇关于使用API​​的一切网络应用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆