OData 和 REST Web 服务之间的区别

编程入门 行业动态 更新时间:2024-10-27 09:39:16
本文介绍了OData 和 REST Web 服务之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

OData 和 REST-ful Web 服务有什么区别?

What is the difference between OData and REST-ful web services?

推荐答案

UPDATE 警告,由于 OData V4 可用,此答案已过时.

UPDATE Warning, this answer is extremely out of date now that OData V4 is available.

我不久前写了一篇关于这个主题的帖子这里.

I wrote a post on the subject a while ago here.

正如 Franci 所说,OData 基于 Atom Pub.然而,他们在顶部分层了一些功能,不幸的是忽略了过程中的一些 REST 约束.

As Franci said, OData is based on Atom Pub. However, they have layered some functionality on top and unfortunately have ignored some of the REST constraints in the process.

OData 服务的查询功能要求您根据响应中不可用或链接到的信息构建 URI.这就是 REST 人所说的带外信息,并在客户端和服务器之间引入了隐藏的耦合.

The querying capability of an OData service requires you to construct URIs based on information that is not available, or linked to in the response. It is what REST people call out-of-band information and introduces hidden coupling between the client and server.

引入的另一个耦合是通过使用 EDMX 元数据来定义条目内容中包含的属性.可以在名为 $metadata 的固定端点上发现此元数据.同样,客户端需要提前知道这一点,它无法被发现.

The other coupling that is introduced is through the use of EDMX metadata to define the properties contained in the entry content. This metadata can be discovered at a fixed endpoint called $metadata. Again, the client needs to know this in advance, it cannot be discovered.

不幸的是,Microsoft 认为不适合创建媒体类型来描述这些关键数据片段,因此任何 OData 客户端都必须对其正在与之通信的服务和它正在接收的数据做出一系列假设.

Unfortunately, Microsoft did not see fit to create media types to describe these key pieces of data, so any OData client has to make a bunch of assumptions about the service that it is talking to and the data it is receiving.

更多推荐

OData 和 REST Web 服务之间的区别

本文发布于:2023-10-07 17:47:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1470078.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:区别   OData   REST   Web

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!