Tuesday, July 18th, 2006

Declarative Ajax

Category: Ajax, Articles, JavaScript

Duncan Cragg thinks that The Right Way to do Ajax is Declaratively:

Don’t write your interactive Web application in custom Javascript! The Web’s Declarative nature needn’t be broken just because you want two-way dynamic data instead of one-way documents on your site.

Instead, write Declaratively to generic Javascripts, plugins and browser features such as Hijax, hInclude, XForms, SVG, XBL, etc.

Duncan goes into details of declarative talks from XTech this year and his thoughts on where we should be going.

Posted by Dion Almaer at 7:26 am

3.8 rating from 54 votes


Comments feed TrackBack URI

Cragg’s post is really thought-provoking, thanks. I wish I could have gone to XTech!

Comment by Lindsey Simon — July 18, 2006

Ajax Projects is a portal for all ajax resources.
it includes reviews for most of the toolkits and frameworks.
it will help you to have the decision which framework or toolkit you will use in your project

Comment by Ajax Projects — July 18, 2006

Imperative code is a glue,what makes app unique among others and justify connection between otherwise separated declarative parts of app.Declarative code capture abstract model which must be approximated to requirements of reality,in most cases.
And..let’s not forget that declarative “refactored” from imperative anyway;-)I’ve seen when declarative code overweight imperative snippet by any means and not hit immediate target anyway-use both wisely.

Comment by Andrey Skvortsov — July 19, 2006

Symfony simple rocks !

Comment by snk00sj — July 19, 2006

The declarative approach has been endorsed by the OpenAjax initiative, and it is one of the 8 characteristics that separates the next-generation of Ajax frameworks from the first generation (Dojo, Rico, Prototype, etc).
The author seems not to realize that at least one framework has already fully implemented a declarative approach and is running in production today.
There is no need to cobble together a diverse collection of libraries and fragments when you can use a framework that packages it all consistently.
There are limits to the declarative approach, but I’ve found that more than 90% of an application can be coded declaratively. The last 5-10% of features often need Javascript so its nice to be able to seamlessly and easily weave Javascript into the declarative code. That last 5% of features are often the critical, unique features that are central to the mission of the application.

Comment by Richard Kernahan — July 19, 2006

KRJS plugin can probably be called declarative RJS for Rails then.

Comment by choonkeat — July 19, 2006

Richard, I think Duncan missed the Backbase presentation at XTech. Its title was ‘AjaX with a capital X’ and it focused entirely on declarative Ajax. Session overview: http://xtech06.usefulinc.com/schedule/detail/136.

Comment by Jep Castelein — July 20, 2006

Jep, actually I renamed the presentation to Declarative Ajax at the last minute because I felt it fit the contents better :)

Comment by Menno van Slooten — July 20, 2006

I skim Ajax blogs, but am not deep into the coolaid, so you’ll have to excuse the question:

Isn’t OpenLaszlo already there? (http://www.openlaszlo.org/)

Given that you write in a combination of XML and Javascript, and can render an OpenLaszlo project to either Flash or DHTML+Javascript, it seems like a very rich framework for rich web apps already exists… and you have a compiler that actually does some useful sanity checking along the way.

Either way, it’s a completely declarative GUI environment that renders to the WWW. I’m surprised it doesn’t come up more in Ajax discussions—unless it is considered to be an abomination, or some other such thing.


Comment by Matt — July 20, 2006

declarative has been around for a while and many ajax companies / frameworks already support various types of it (backbase, eba, dojo etc). indeed openajax is focusing on the declarative approach as the way forward.

the ajax community can really get a lot out of looking at the work done by adobe on MXML, the W3C with XForms and sXBL, Laszlo with LZX (as Matt says), and MS with XAML.

but we definitely still need script to glue things together. declarative cannot be all things to all people :)

(hey jep)

Comment by Dave Johnson — July 21, 2006

Leave a comment

You must be logged in to post a comment.