开发者

New oData javascript library (from MSFT) compared to jQuery

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-li开发者_如何学运维brary-for-odata-and-beyond.aspx


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.


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.


This library has nothing to do with jQuery.

It makes specialized AJAX and JSONP requests for OData feeds.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜