New oData javascript library (from MSFT) compared to jQuery

蹲街弑〆低调 提交于 2019-12-21 05:14:19

问题


What is the benefit of the new Javascript OData library over using jQuery?

http://blogs.msdn.com/b/astoriateam/archive/2011/02/08/new-javascript-library-for-odata-and-beyond.aspx


回答1:


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.




回答2:


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.




回答3:


This library has nothing to do with jQuery.

It makes specialized AJAX and JSONP requests for OData feeds.




回答4:


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".



来源:https://stackoverflow.com/questions/4948527/new-odata-javascript-library-from-msft-compared-to-jquery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!