Matt RaibleMatt Raible is a Web Developer and Java Champion. Connect with him on LinkedIn.

The Angular Mini-Book The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication.

Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy.

For book updates, follow @angular_book on Twitter.

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.

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 in The Web at Feb 01 2006, 03:15:02 PM MST 17 Comments
Comments:

Crap, it's been nearly 5 hours and no one has responded!? I haven't used either library yet (no call for it at this time) but I've been wondering which one to go with when the time comes.

Posted by Lance on February 02, 2006 at 02:55 AM MST #

We recently did the same evaluation you did. I think Dojo has some interesting concepts and I think they are taking a very different approach to their development them most of the other libraries (if you're interested, listen to the Ajaxian.com podcast featuring the lead from Dojo.. interesting listen). They are focusing their efforts on building a toolkit and they are taking a true "developer's" perspective to working in JavaScript. Their concepts of testing JavaScript and their build system to run all of their JavaScript outside of the browser for testing (using Rhino) is very interesting.

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 #

Niall - the big names getting behind Dojo is certainly interesting. However, we both know that good marketing can make an inferior product succeed. As far as Scriptaculous and Commons Validator - I haven't had any issues. It works fine in my Equinox as well as in AppFuse. Could be fixed by Prototype (1.4.0) or Commons Validator (1.2.0).

Posted by Matt Raible on February 02, 2006 at 02:15 PM MST #

Off topic: What podcasts have you been listening to?

Posted by 205.242.255.66 on February 02, 2006 at 04:27 PM MST #

Well, I can't find your Trackback URL, but I posted my thoughts on my blog.

Posted by Jason Carreira on February 02, 2006 at 04:38 PM MST #

RE: Podcasts - I've been listening to Audible Ajax (Ajaxian), The Java Posse, Swampcast!, the Ruby on Rails Podcast and Behind the Mic w/ Doug Kaye (which I believe is IT Conversations). I've found that listening while working really doesn't work - but listening during my commute (via bicycle) works great. At 30 minutes each direction, I can rip through 1-2 podcasts per day.

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 #

Recently i had to choose a js library for my next project (RIA) and therefore had a quick look at some of them: Rico, Prototype, MochiKit, DojoKit, Script.aculo.us, The X Library,...

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 #

Hi,

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 #

Hey Kristian,

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 #

Gah, why won't this damn thing make newlines breaks? *sigh*

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 #

Alex - thanks for all your comments, they're greatly appreciated. As far as the line breaks, it's because my comments currently support HTML-only syntax, so it doesn't do line breaks unless you use <br /> or <p>. That's what the "Preview" button is for. ;-)

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.

... Demo ...
<div dojoType="SplitPane"
	orientation="vertical"
	sizerWidth="5"
	activeSizing="1"
	layoutAlign="client"
	debugName="split pane 2"
	sizeMin="100" sizeShare="3" 
>

Posted by Kristian on February 02, 2006 at 07:46 PM MST #

I did not have time to fully digest the Dojo licence but mention of their dual style license being similar to MySql was a concern.

Posted by Sanjiv Jivan on February 02, 2006 at 11:03 PM MST #

Kristian: that's correct. You can define those properties in sub-elements that take their values from the text node directly below the property element (think if it as a microformat). That's a validating option but deeply inefficient. You can also use namespace'd tags and attributes, but YMMV WRT browser support. I personally feel that validation (not well-formedness) is over-rated, but Dojo gives you options no matter what your leanings.

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 #

Hey Matt,

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 #

Post a Comment:
Comments are closed for this entry.