New oData javascript library (from MSFT) compared

2020-06-21 06:28发布

4条回答
一夜七次
2楼-- · 2020-06-21 06:42

This library has nothing to do with jQuery.

It makes specialized AJAX and JSONP requests for OData feeds.

查看更多
干净又极端
3楼-- · 2020-06-21 06:49

This is what they say of the library:

Over time we plan to evolve datajs into a comprehensive library that can be used to develop rich data-centric web applications. It is designed to ... provide functionality for structured queries, synchronization, data modification, and interaction with various cloud services, including Windows Azure.

This is a pretty narrow scope of features when compared to jQuery. It seems Microsoft isn't trying to compete with jQuery here, but create an alternate data-access library that interacts with a server using the OData protocol. Indeed, as far as I can tell, jQuery already does all of this stuff, so it seems this is just a way to have access to smart data calls without using the entire jQuery library.

查看更多
男人必须洒脱
4楼-- · 2020-06-21 06:54

You typically will use them together, as datajs is good at talking to an OData service while jQuery is for comprehensive DOM manipulation and convenient AJAXing. As such a tool, you can implement talking to an ODATA endpoint using jQuery but that's an enormous amount of work - eventually this is what datajs is, and it is over 300K source.

If you would like to have the way jQuery makes your life easy (fluent API, easy intuitive facade) in the field of working with ODATA I'd recommend checking out JayData - "the jQuery in data manipulation".

查看更多
爷的心禁止访问
5楼-- · 2020-06-21 07:00

jQuery is very good at what it does and datajs doesn't try to duplicate any of its features, so it's hard to answer the question in those terms.

datajs currently implements extensive OData support, including multiple formats, support for parsing conceptual models, the ability to enhance results when metadata is known, batch handling, etc.

jQuery supports JSON usage, but that's really just a matter of encoding - there is no support for any OData-specific behavior. If you're talking to an OData server, you'll be better off using datajs, and then you can use jQuery for everything else: animations, document building, controls, templating, etc.

查看更多
登录 后发表回答