Monday, January 30, 2006

 

Generating the ideal AJAX format with Eiffel

The Ajaxian links to a post discussing the ideal AJAX server response format:

Once you’ve succesfully fired an AJAX request, what sort of response should the server give? An XML document? An HTML snippet? A JSON string which is converted to a JavaScript object? Or something else? In this entry I’d like to discuss the three formats, with examples, and ask you which format you’ve used in your practical AJAX applications.

With Eiffel we easily can generate the XML documents and HTML snippets by using the Gobo or eposix tools. There's no JSON support in Eiffel yet.

Comments:
JSON is a straightforward specification that would be easy to implement for Eiffel (I did some of the work for the Parrot JSON library).

An Eiffel JSON library would be useful beyond AJAX applications - for example it would make a good default format when dumping Eiffel objects for debugging purposes (e.g. as the output format of ANY.tagged_out).

A superset of JSON called YAML might also be interesting as a kind of lite "STORABLE" for Eiffel.
 
My first thought would be to return an HTML snippet. I try to keep my Javascript as simple as possible since it is a less robust programming and execution environment then the Eiffel I run on the server (and I am a less robust Javascript programmer). That said, the availability of Javascript parsing libraries could sway me to push more processing out to the browser.

At present it's a rather academic question for me. I don't anticipate implementing any functionality that really requires AJAX for at least a year. Right now, the first AJAX application I see for me will be something like the google search pulldown for users selecting items by name from a large database.
 
Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?