Script.aculo.us vs. Dojo
For the last week or so, I've been hearing more and more about Dojo. It's mostly because I've been listening to podcasts, but also because it's integrated into both WebWork 2.2 and Tapestry 4.0 (via Tacos). In AppFuse 1.9, we added Script.aculo.us as one of our Ajax-enabling libraries.
I chose Script.aculo.us because I've used it in the past and it's worked very well (along with its underlying engine, Prototype). Because it's development seems to be largely driven by Ruby on Rails - I figured it was a good library to include. However, since AppFuse includes both Tapestry and WebWork - it seems like including Dojo might be a good idea too.
So my question is - do Script.aculo.us and Dojo do the same thing? Has anyone done a detailed comparison of these two Ajax frameworks?
I realize that Dojo is more of a "toolkit" that's been developed from a bunch of existing DHTML libraries - but can it do the drag-n-drop and cool effects like script.aculo.us can? Can Dojo do things that DWR + Script.aculo.us can't? I haven't used Dojo (yet), that's why I'm asking.
I really like the idea behind both projects, but I can't help but think Script.aculo.us is a little better. Why? Because its creator is a designer (vs. a developer) and its development is driven by one of the most popular web frameworks and it was built from a real-world application rather than a consolidation of libraries.
Dojo, on the other hand, has much better documentation. However, the project lead works for JotSpot. Apparently, the JotSpot Wiki is supposed to be a showcase of what Dojo can do. While the jot.com site looks OK - the Dojo Wiki (based on Jot) is horrific. Things don't line up and it looks awful (in both IE and Firefox on Windows + Firefox on the Mac). On my last project we used Jot and it left a lot to be desired.
I hate to judge a library by the applications it creates - but comparing fluxiom to Jot makes me think Script.aculo.us is the better library. Then again, fluxiom hasn't been released yet.
On a related note, it's possible the Open Ajax project will consolidate the Ajax frameworks - but who knows when that will be released.
Posted by Lance on February 02, 2006 at 02:55 AM MST #
However, when we tried to write code in dojo and Prototype/Script.aculo.us, we came away believing that the Prototype/Script.aculo.us combination was the winner. The code we had to write was smaller, easier to write, and seemed to work across more of the major browsers. So, we went with Prototype/Script.aculo.us.
One positive note on Dojo: the one thing I really like in Dojo is the package system. I think JavaScript really needs something like that!
Posted by John Townsend on February 02, 2006 at 04:54 AM MST #
I can't comment on the merits of dojo over Script.aculo.us/prototype - but I believe you were bitten by a similar problem using Commons Validator.
Also, big names seem to be getting behind dojo with the Open Ajax and I am Alpha.
Posted by Niall on February 02, 2006 at 11:51 AM MST #
Posted by Matt Raible on February 02, 2006 at 02:15 PM MST #
Posted by 205.242.255.66 on February 02, 2006 at 04:27 PM MST #
Posted by Jason Carreira on February 02, 2006 at 04:38 PM MST #
Jason - thanks for the writeup. I had to disable Trackbacks b/c I was getting so much spam. I hope to re-enable them when I upgrade to Roller 2.1 - which should be released in a week or two.
Posted by Matt Raible on February 02, 2006 at 04:54 PM MST #
I realized it becomes almost impossible to create valid xthml documents when using MochiKit or DojoToolkit because they add proprietary attributes to html tags that are spread all over your document.
I think a good and easy to maintain application has to separate the markup completety from your js code (generating of pages becomes easier too).
You can achieve this by using a behaviour.js-like script and a getElementsBySelector-script to select the nodes and add the desired events/functions/...
Finally i've choosen prototype + behaviour + script.aculo.us + getElementsBySelector script
Posted by kristian on February 02, 2006 at 05:11 PM MST #
I haven't looked much at Script.aculo.us yet. But I have been looking at dojo. I really do like their packaging and widget concepts. As far as cool effects, you can check out their unit tests at the following links which demonstrate some of the cool effect that you are speaking of:
http://archive.dojotoolkit.org/nightly/tests/http://archive.dojotoolkit.org/nightly/tests/dnd/
http://archive.dojotoolkit.org/nightly/tests/widget/
Note, that these links are to dojo's unitTests which are run against their latest code base. The first time I checked out the drag-n-drop functionality it worked very smoothly, but it appears as though the onmouseup event is not currently being fired correctly in these tests as of a few minutes ago.
Thanks for starting this thread.
Posted by Jason Buchanan on February 02, 2006 at 05:12 PM MST #
So I'm one of the Dojo devs and a Jot employee. The main argument presented against Dojo here is that we're not driven by the design community, and it's true. We are trying to provide a solid engineering foundation for you to build on. We excel in giving good designers good tools, not in imposing our sensibility onto your projects.
Your asked "can Dojo and Scriptaculous do the same things?". I think the answer is that Scriptaculous provides a subset of what Dojo can provide. Furthermore, Dojo gives you things like a package and build system so that your app only needs to pull in the libraries that it's actually using. It's one-stop-Ajax-shopping as opposed to the endless gluing of libraries together that seems to be required in a Prototype+Scriptaculous+Behavior environment.
As for the wiki and Dojo being driven by applications, I suggest you check out http://manual.dojotoolkit.org/index.html and http://tracker.jot.com. If you like, I can also get you an invite to renkoo.com. These are the applications that are driving Dojo development, and I think you'll find them much more visually appealing that the old Wiki theme. Tracker, in particular, uses Dojo heavily to provide the kind of interface that is difficult to replicate w/o some solid client-side engineering. The manual site uses the new Jot theme and makes significantly more appropriate use of Dojo to provide things like in-place commenting and file uploading.
Posted by Alex Russell on February 02, 2006 at 05:44 PM MST #
Your assesment of Dojo requiring non-validating attributes is flat-out wrong. While it's possible to use a dojoType="widgetName" attribute to declare a widget in a page, you can do exactly the same thing with class="dojo-widgetName". They are functionally equivalent in the eyes of the Dojo first-pass parser.
Regards
Posted by Alex Russell on February 02, 2006 at 06:16 PM MST #
Jason, I suggest you look at (and work from) the tests from the releases. e.g.: http://download.dojotoolkit.org/release-0.2.2/dojo-0.2.2-ajax/tests/dnd/
Regards
Posted by Alex Russell on February 02, 2006 at 06:19 PM MST #
The good news is I get e-mail notifications of comments and fixed all yours to have proper line breaks.
Posted by Matt Raible on February 02, 2006 at 06:24 PM MST #
Hey Alex,
does this mean there is a way to add/set the object properties without actually using non-valid attributes? If so it'd be great. I was not aware this were possible.
Posted by Kristian on February 02, 2006 at 07:46 PM MST #
Posted by Sanjiv Jivan on February 02, 2006 at 11:03 PM MST #
SanJiv: Dojo's dual licensing system is solely for the purpose of making it *even more* compatible with both open and closed software environments and licenses. Both of our licenses (AFL and BSD) essentially allow you to use any of our code in any environment for any purpose, no questions asked and no constraints imposed. We were forced to add the BSD license because the FSF has interpreted the AFL as being incompatible with the GPL and our goal is to "optimize for adoption and not for control". Not being able to be used alongside GPL software wasn't a viable long-term situation for us, but we have not adopted any kind of licensing regime like MySQL. You can read more about our licensing philosophy at: http://dojotoolkit.org/community/licensing.shtml
The legal structure of the way we dual-license is similar to MySQL, but the reasons are not.
Regards
Posted by Alex Russell on February 03, 2006 at 02:42 AM MST #
I commute 30 minutes each way to work while listening to podcasts too! I also do a 2 hour ride on the weekend doing the same. I'm spending a lot less time reading blogs, now. A real time-saver and it makes the miles go faster.
Posted by Michael Slattery on February 04, 2006 at 03:26 AM MST #