使用odata或MVC返回json?
我正在尝试使用ajax来进行CRUD。我应该使用 ODATA 还是 MVC?我也计划在移动平台中使用 json。
谢谢大家
I am trying to use ajax to do CRUD. Should I use ODATA or MVC? i am also planning to use json in mobile platform as well.
Thanks guys
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有点主观 - 但 ODATA 的两个关键点是:a)在服务器端为您完成了大量繁重的工作;b)还有库可以在客户端提供帮助。缺点是您必须做它所做的事情,因为您将其指向可能非常复杂且灵活的实体。
使用 MVC,您必须完成所有自己的工作,但作为回报,您会得到您所需要的东西。
在所有其他条件相同的情况下,我可能会从 ODATA 开始......
Somewhat subjective - but the two key things with ODATA are that a) huge amounts of heavy lifting is done for you at the server end and b) that there are also libraries to help at the client end. Downside is that you have to do what it does although since you're pointing it at entities that can be quite complex and is flexible.
With MVC you have to do all your own work but in return you get exactly what you need.
All other things being equal, I'd probably start with ODATA...