Thursday, April 13, 2006

ZK and OpenLaszlo : Ajay and Vijay

Bhaiyaaaaaa!

You know the story; two brothers visit the Kumbh Mela and are separated in the crush. One grows up to be a policeman, while the other becomes a vagabond and eventually a hardened criminal. Both of them are then united under extremely contrived circumstances, only to find themselves set against each other. However, everything is eventually resolved, and both of them join hands to save their widowed mother from the hands of the (muwahahaha!) evil villain. Or something like that...

ZK and OpenLaszlo seem to me like the Ajay and Vijay of Web UI. On the one hand you have ZK, an extremely rich AJAX based Web UI Library which allows you to define the interface in XML, while OpenLaszlo is extremely rich Flash based Web UI Library which allows you to define the interface in XML. They're both Open Source, use JavaScript for scripting and are absolutely gorgeous.

Designing using these libraries is really straightforward too. Here's how to make a window with the canonical "Hello World".

ZK:

<window title="1st window" border="normal" width="200px">
Hello, World!
</window>
OpenLaszlo:
<canvas>
<window>
<text>Hello World!</text>
</window>
</canvas>

Not much to choose between huh? :-)

The difference between the two of them is in their emphasis. ZK bills itself as an easy to use AJAX library while OpenLaszlo is more ambitious, describing itself as a way to create "zero-install web applications with the user interface capabilities of desktop client software" In addition, OpenLaszlo can now be compiled into DHTML, not just Flash.

So which one will I use if I need something like this? I'm not exactly sure. It's not just a competition between these two libraries, but between using Flash or Ajax for your UI too. If I'm pushed to it, I'll probably side with OpenLaszlo. This is largely because it can also be compiled to DHTML as well as Flash and because the demos at www.openlaszlo.org really put it through it's paces and show what it can do. In addition, there's a Flash player available for mobile devices now, but Javascript support on those things can be spotty. Javascript windows and animations really crawl on Firefox under Linux too and since that's my primary platform at home and at work, it's a significant downside for me.

There really isn't that much to choose between them. It'll probably boil down to personal preferences. Both libraries are well supported, stable and under active development. Both make the task of creating absolutely stunning interfaces almost trivial.

Ajay or Vijay, it doesn't really matter. The bad guy goes down in the end.