The Dojo toolkit looks like it is very useful, but the docs feel very incomplete and buggy. Can anyone suggest a book or other resource to help a javascript novice really learn to use Dojo?
I have Dojo: The Definitive Guide by Russell and Dojo: Using the Dojo JavaScript Library to Build Ajax Applications by Harmon. I needed both books but once I had gone through the Harmon book I have not referred to it much, if at all. The Russell book, however, I have kept by my side and refer to it frequently. Harmon's book gave me an overall understanding and a quick way to use the toolkit. Russell's book takes you through the toolkit from zero knowledge of the toolkit.
There are a number of useful resources for Dojo out there...
Online documentation:
Dojo Book: The online reference guide for Dojo is pretty comprehensive, and is generally updated. During 2008, the docs will move to a more editable site at DojoCampus.
API Reference: Want to know the attributes for customising a
ContentPane
? Or the parameter order fordojo.connect()
? Hit the Dojo API Reference and look it all up. Commenting is available too so leave your experiences there.Dojo Campus is the home of learning resources for Dojo. It includes a Feature Explorer, the new Documentation, podcasts, tutorials, and cookies (helpful bite-size tips for Dojo)
Demos & Tests are a great way to see how the different components can be used, combined, and customised. The online archive has links to test pages, and they're also available in the downloads and checkouts under
<dojo/dijit/dojox>/<module>/tests/
Others:
- The Dojo Toolbox is a desktop app which provides an offline version of the API reference and a number of other tools and links.
- The Key Links page on the Dojo website links to lots of tutorials around the web.
Blogs:
- The Dojo project blog covers what the contributors are working on, and what's new from the roject.
- Planet Dojo collects Dojo and Javascript/web related blogs together in a handy aggregator for the wider community.
- SitePen employs a number of the Dojo developers, and have a fantastic blog which goes into the nuts and bolts of new and exciting Dojo stuff.
Books:
- Dojo: The Definitive Guide by Matthew Russell is a really comprehensive reference book on the core Dojo and Dijit libraries, but with plenty of background and useful additions so that its not just another API reference.
- Mastering Dojo explains how and why Dojo is put together the way it is put together the way it is, and gets into the guts of how it all works.
- Dojo: Using the Dojo JavaScript Library to Build Ajax Applications is a really easy introduction to the toolkit to enable people who aren't overly familiar with the Web/Ajax/Javascript thing to get started.
- There are more books coming out in 2008/2009 so keep a look-out.
- A great discussion of the three Dojo books by Alex Russell (Dojo's founder).
- The Dojo Campus book corner
This afternoon I was running into a Dojo problem that just wouldn't budge. I boiled it down to a case that was simple enough to ask for help on the #dojo channel on the FreeNode IRC network. A Dojo developer took a look at my issue very quickly, determined that it was due to a bug in a recently-created interface, and brought the developer who had written that module into the conversation. There was a bug fix in the trunk within half an hour, and everything worked fine afterward.
If you just can't get anywhere with the examples or the documentation, I'd recommend joining #dojo.
I have Mastering Dojo by Gill, Riecke and Russell, but I'm looking for something more information dense and less erroneous. For example, here's an error I noticed:
"In good object-oriented frameworks, some built-in methods are meant for the programmer to call, and some are meant for the programmer to override. A good example of the latter is compare in Java. This method is defined at the root of the class tree (Object) and overridden in most of the built-in classes." (p. 329)
I think they meant equals, not compare. See http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#equals(java.lang.Object)
Also, in the section explaining the widget lifecycle, Mastering Dojo does not mention the methods destroyRecursive and uninitialize. By contrast Dojo: The Definitive Guide does mention those methods, and explains all the lifecycle methods in more detail than Mastering Dojo does.
Another thing I found disappointing about Mastering Dojo is that it's very "Pro-Dojo". It takes the viewpoint of a fervent Dojo advocate, rather than that of an even handed teacher. In and of itself this is not bad, but when one of the book's authors is a major Dojo code contributor, it makes me lose confidence in the book's objectivity. I mean, opening chapter one with this sentence strikes me as a bit arrogant/pretentious/biased/blind:
There's a new king in town.