Tuesday, June 24, 2008

Dojo and The Incredible Shrinking Server

When you start using Dojo, your focus naturally shifts to the browser. The complexity you once shoved into server-side scripts begins to dissipate. JSP, ASP, Rails and PHP tasks like:

- Generating HTML based on dynamic data
- Validating and massaging user input
- Directing the navigation path

In a Dojo Rich Internet Application, some of this responsibility shifts to Dojo and JavaScript. For example, you now do validation and input massaging with dijit.Form elements. You generate HTML directly from the Dijit components themselves and from Dijit templates.

Some of the responsibility disappears altogether. Navigation from page to page, for example, doesn't matter if you only have one page. So the answer to the question "Where is the Dojo equivalent of Struts or CakePHP?" is "Nowhere."

It's fairly common for Dojo applications to slim down to pure HTML and JavaScript. Suddenly a circa 1995 web server is the right size for serving up your site. What's more, the web applications look like client-server apps from 1995, albeit more connected. Everything old is new again!

So what is the middle tier doing for you? Why not just connect your browser straight to your database and cut out the middleman, as it were? Well, you could. But don't go unplugging servers yet! There turns out to be lots of work you can do on the middle tier. And the nice part is a lot of this work can be done without programming. This is where Service Oriented Architecture comes in. I'll tell you what I mean in tomorrow's post...

Saturday, June 21, 2008

Instant Book Gratification

What's that? You promised this great new Ajax application in 2 weeks? You could probably use a good JavaScript toolkit and a good book on how to use it. May I suggest Dojo (http://www.dojotoolkit.org) and Mastering Dojo as the book? It's now available for electronic purchase at Pragmatic - http://www.pragprog.com. Printed copies purchased there will start shipping the week of June 23rd. Or you can buy them at Amazon the week after, or at your favorite bookstore the week after that.

Pragmatic Press books have their own style. If you've read one of their books (like the bestselling Agile Development with Rails), you know what I mean. They read like novels where the first chapters really grab you, then the subsequent ones unfold the topics evenly and gracefully. People have different learning styles, but I particularly like this format because it helps you learn the Way of Dojo - in other words, what concepts hold it all together. The more you learn the concepts, the less you need to memorize. Sounds good, eh?