3rd Party Ajax Libraries... Advice needed

I know many of the people who visit these boards are programmers so I figured I would let out a call here.

We just finished a release so now we have time to refactor some of the crap we did "just to get done in time". One of the major issues that I brought up was the fact that we are utilizing multiple Ajax libraries in our UI.

They are:

Dojo
Zapatec
DWR
HomeGrown (blech)

So, one of my coworkers and I have spent the last couple weeks trying to decide if it was not only possible to go to one library, but which library should we choose. It was my task to look at Zapatec and so I took many of our pages and rewrote the whole thing in that library. His task was broader in the sense that he was looking at both Dojo and Zapatec.

Anyway, I finished my report and got a pretty good feeling on this library. Although it isnt as easy to extend as say Dojo, it seems pretty good at what it does and its rather easy and efficient to get things up and running. It has very good documentation and I did have some issues that I posted on their forums and got pretty decent response times for solutions.

Dojo on the other hand is true OpenSore. While it boasts a HUGE feature list, the documentation seems to stink (let alone their own site doesnt work in IE7). But it has a lot of cool features, its free and its easily extendable.

So, what other 3rd party Ajax libraries have some of you worked in? Did you like them? Would you recommend them? Free or not, I dont really care since we were given the go to "use the best thing for our company".

Has anyone used Yahoo's libraries/toolkit? What about Googles?

Thanks!

PAR

jQuery is supposed to be really good.

I did some work with YahooUI about 2 years ago, and it was complicated and a struggle to work with then. Probably gotten a lot better since then.

JQuery is really good - almost good enough to make me want to do things in Javascript.

I'm using jQuery but that's the only lib doing Ajax I have experience with, so I can't make any real comparisons. Their getJSON function takes care of the "Ajax" part of what I needed it for and it works very well. I'm also using jQuery for some other stuff and I'm pretty happy with the choice. Browsing the Ajax part of the docs will probably give you enough info to discard it if it's not what you need.

Thanks for the responses guys.

Do any of you who have used this library know if there is a decent unit test plugin for it? I dont quite understand the JQuery/Sprint documentation.

Thanks!

PAR

Par, I have not used any of the ones you listed above, but have used jQuery some. I must say, though, that in my experience, Prototype blows jQuery out of the water. The reason is simple: Prototype extends the HTML/JS DOM. What this means is that when you load Prototype on your page, it takes functions and properties that you're used to, and makes them better with ajax, etc. The result is a library whose functions are intuitively named; often I can guess what a function does (and what it's named) without having to look at the documentation. jQuery, on the other hand, is a collections of methods that have no rhyme or reason behind their names -- from what I can tell, the naming convention favors the fewest keystrokes and not programming logic. This is not to say, however, that jQuery is bad; it's just that I've not found a place where Prototype (partnered with Script.aculo.us) doesn't do something as good or better than its jQuery counterpart. I can't recommend Prototype enough.

Thanks Bagga I'll look into it today... does it have any type of unit test embedded functionality? One of our senior devs is a unit test whore... literally

PAR

par wrote:

Thanks Bagga I'll look into it today... does it have any type of unit test embedded functionality? One of our senior devs is a unit test whore... literally

PAR

Unit testing is a godsend. You should learn to love it

Soon I'll be using extjs as the JS framework and Json as the JS serializer for .net objects myself. Should be fun.

Dr.Ghastly wrote:
par wrote:

Thanks Bagga I'll look into it today... does it have any type of unit test embedded functionality? One of our senior devs is a unit test whore... literally

PAR

Unit testing is a godsend. You should learn to love it

Soon I'll be using extjs as the JS framework and Json as the JS serializer for .net objects myself. Should be fun.

Oh I'm not against unit testing... in fact I've been doing it in every one of my projects for the past 10 years. But there is a point in which there is TOO much time/effort going into unit tests. When your unit test code is 4x's the size of the code youre testing... there's something wrong

Andrew Jackson wrote:

“There are no necessary evils in unit tests. Its evils exist only in its abuses.”

PAR

Yeah, I can't recall the name of the tool, but there is one that will tell you how much your unit tests are hitting various pieces of code in your project so you can tune the tests to hit rarely tested places and tone down the ones that are getting slammed unnecessarily.

I'll have to see if I can find that information.

Dr.Ghastly wrote:

Yeah, I can't recall the name of the tool, but there is one that will tell you how much your unit tests are hitting various pieces of code in your project so you can tune the tests to hit rarely tested places and tone down the ones that are getting slammed unnecessarily.

I'll have to see if I can find that information.

Thanks Dr!

I've also found some interesting comparisons on the net:

http://michael.futreal.com/blog/0000052

http://jquery.com/blog/2006/10/18/ze...

I have to admit though, Prototypes documentation is severely lacking... unless their documentation isnt found on their site?

PAR

Have you looked here: http://prototypejs.org/api ?

They have online, pdf, and chm API documentation.

Oh, also, that zebrat test comaprison page has this listed below:

Prototype 1.5.1: (demo)
$$('tr:nth-child(odd)').invoke('addClassName', 'odd');

So if you're using lines of code (or even # of characters) for a comparison between jquery and prototypejs, prototype 1.51 is looking better for that test than 1.5.0.

Am I missing something? I see that this Prototype is a pretty nice Ajax/Javascript toolkit, but does it not already have prebuilt widgets? Do you have to make all of them on your own? Part of the "attraction" of some of the other libraries like Dojo, Zapatec and JQuery (via the community) are the prebuilt controls that have already been tested.

PAR

My preference for JQuery over Prototype probably has to do with my mostly being a server-side guy who occasionally has to venture into Javascript/browser land. Looking like old style DOM javascript is not a feature for me.

par wrote:

Am I missing something? I see that this Prototype is a pretty nice Ajax/Javascript toolkit, but does it not already have prebuilt widgets? Do you have to make all of them on your own? Part of the "attraction" of some of the other libraries like Dojo, Zapatec and JQuery (via the community) are the prebuilt controls that have already been tested.

PAR

It's the foundation for lots of other things. Google is your friend, but for interface sexiness, look at script.aculo.us. What specifically are you looking for?

Needing the web interface to act and perform as closely to a native UI as possible, its nice to have a library of controls that are already written and tested so that you dont have to write them yourself (why reinvent the wheel.. its 2008 for gods sake).

Anyway, this or this or this is part of the criteria for choosing a library. Having prebuilt objects that can control not only the entire interactive functionality of a "widget" (i.e. a calendar, tab, tree, pane, etc), but also an efficient interface for controlling the "Look and Feel" is essential. But these also need to be cross-browser compatible.

So my question is does Prototype offer such an API? I do not see anything like this in the Prototype library and searching only comes up with a couple guys making some "widgets" and offering them for use (in regards to script.aculo.us, it looks ok but it doesnt quite have a feature set that is in the bounds of what I need. And many of their links, like the demo links, go nowhere: 500 error). Prototype looks good, but as a requirement I need something a little more.

PAR

Have you looked into extjs? www.extjs.com

We use prototype/scriptaculous and, to a lesser extent, EXT here. The decision to do so was made my more experienced (in AJAX, anyway) developers than I so I can't give you much comparative commentary but I've had no real complaints in using them. Consider this a recommendation not because I think/know it's better than any of the other libraries but because I've not had any major trouble getting them to do what I want.

par wrote:

Having prebuilt objects that can control not only the entire interactive functionality of a "widget" (i.e. a calendar, tab, tree, pane, etc), but also an efficient interface for controlling the "Look and Feel" is essential. But these also need to be cross-browser compatible.

I don't have a whole lot of experience with the other js libraries, but it's kind of sounding like your reqs fit with the Yahoo UI stuff.

Like:
Tabs
Trees
Calendar

I've found the yui stuff to be pretty developer friendly -- you can view the full source easily and the api docs are pretty thorough -- and the libs are "Grade A" cross browser compatible.

If you do end up using this lib and you ever need some help, drop me a line.

I've been using GWT for a long time, and it's really powerful.

You write your code in Java, using their libraries, and you can debug it in Java (e.g. in Eclipse). Once you're all set, you can compile the code down to JavaScript for inclusion in a page. (In fact, it automatically compiles into multiple JS files, one for each browser, loaded via an autodetect script).

The translation layer is actually very good - you get virtually identical behavior in the simulated Java version as the final JS version.

But the compilation step is a little tricky. It's tempting to start using all sorts of Java libraries, but only a subset is supported (Google provides their own replacements, especially for UI stuff, so that they can compile them to JS). And compiler errors leave something to be desired.

Still, it's probably the most programmer-friendly AJAX toolkit out there.

My company is using the Yahoo User Interface, mostly because of the depth and breadth of its features and its (comparably) excellent documentation. Some of the developers prefer script.aculo.us for its effects, but I personally think it's a bit light on functionality for our purposes. Still, it does have some really nice looking effects.

I looked at GWT's documentation but was concerned that the view layer was being placed into Java code. We have distinct groups of designers and programmers, and I didn't think it'd work well for the designers to be messing with Java code. Perhaps someone who's used it can clarify how that works.

I've been using jQuery and it's been working out well.

GWT always makes me nervous. The idea of writing code in Java and then compiling to javascript just doesn't sit well with me - extra layer of translation and all. But for someone who's coming from that background I can see how it would be useful.

doihaveto wrote:

I've been using GWT for a long time, and it's really powerful.

You write your code in Java, using their libraries, and you can debug it in Java (e.g. in Eclipse). Once you're all set, you can compile the code down to JavaScript for inclusion in a page. (In fact, it automatically compiles into multiple JS files, one for each browser, loaded via an autodetect script).

The translation layer is actually very good - you get virtually identical behavior in the simulated Java version as the final JS version.

But the compilation step is a little tricky. It's tempting to start using all sorts of Java libraries, but only a subset is supported (Google provides their own replacements, especially for UI stuff, so that they can compile them to JS). And compiler errors leave something to be desired.

Still, it's probably the most programmer-friendly AJAX toolkit out there.

The only downside being, you have to write Java.