09 May 2006

Ajax Issues

Ajax, a step forward and a step backwards.

There is gotta be around hundreds of different kinds of ajax framework out there and they all claim to be better than the other.

My biggest pet peeves with most of these frameworks is that while a lot of attentions have been focused on how to retrieve data  from the server, but very few of them address the problem of binding the data to the front end gui.  For gods sake, what use does it serve if I can't easily bind the data to my gui componets AND render them into the format of any html that my designers designed? 

Traditionally, with the old server side solutions, we could easily use server side components to render the gui. It didn't have the ajax features, but it provided us the flexibility. Now with Ajax, while it provids the smooth client call back, but we lost the flexibility of rendering the gui itself.

Quite a few of these ajax frameworks do a good job of getting the data from back end. Some of the typical data types being returned

  • Primitive types (int, string, dates, etc)
  • Array
  • Custom Object
  • Collections (of objects)
  • Maps
  • Image
  • or complicated types in JSON format

Typically, while binding to simple things like text in a <div> is easy, but let's say you want to bind the returned information into a table, a grid, a dropdown, radio groups, checkbox groups or more complicated strctures,. if you look around,  typically there are three suggestions

  • Loop through the returned data and render the html yourself in javascript
  • Return the whole table html from the server
  • Render the gui using buildin module with the limitation that you HAVE to have this <div> and that <div> in a paticular hierachy.

None of these solution is usable in my opinion. Render a whole table myself in javascript? You know how messy that could get? Same goes for the server side rendering solution.  What if I want to sort the table, what if i want to page the table? What if I want to add a paticular scripting in a paticular column?

So what's missing is a unified Javascript UI framework that's cross browser, supports JSON and other formats as their data source and at last provide a complete set of corresponding GUI componets that are bindable and at the same time, do not enforce any layout restrictions to the users. 

I want to take a moment and point out that Atlas server side scripting did  provide a good solution as you can wrap ajax (updatepanel) around the current server-side gui components, but the client side scripting is less flexible in two ways

  • requires web services
  • requires pre-defined layout, for example, < (still need to dig more and see if i'm wrong)
  • In addition, the allowed returned types are limited at this minute. For example, image type does not seem to be supported (again, i need to test that)



 
Anonymous comments are disabled