Inside Laszlo

I spent a few hours last night playing with Laszlo and liked what I saw.  Laszlo address many Flash shortcomings, allowing programmers to use Flash as front-end for web-based enterprise software without dealing with all the mess that has piled on top of Flash all these years.  Having spent a lot of time on a similar idea, I know that what they have accomplished is an impressive feat.  Frankly, I don't think I could have designed it any better.

Laszlo pulls together many open source Java packages such as:

  • Axis – for web services
  • Batik – for SVG support
  • FOP – for XSL-FO support
  • JDOM – for simplified DOM manipulation
  • JGenerator – for SWF generation
  • Jing – for RELAX NG validation
  • JXPath – for XPath support used to select dataset nodes
  • Jython – don't know what for yet (it's Python on Java)
  • OpenOffice – probably for OpenOffice file format support
  • Xerces/Xalan – for XML parsing, DOM, and XSLT
  • XPP3 – an implementation of XmlPull API

Laszlo can be most readily integrated with J2EE applications because it is entirely Java-based and LZX, Laszlo's XML-based Flash UI description format, can be generated easily with JSP.  Following diagram shows how this works:

Hello.html is just a static page that embeds a movie returned by Hello.jsp.  Browser loads Hello.html which causes the Flash plugin to fetch a movie from Hello.jsp.  Hello.jsp emits LZX, instead of HTML, which is used by Laszlo to generate and return SWF.  With minimal efforts, other control flow can be used and processes can be added (i.e. XSLT) as long as LZX is fed into Laszlo in the end.  Neat.

There are, however, some issues with Laszlo that affect developerment and user experiences.

First, LZX to SWT conversion takes a while, much longer than JSP compilation.  Add up everything and you got enough delay to affect development experience.

Second, a Laszlo-based webpage is slower to load than DHTML-based webpages.  This is understandable because a Laszlo-based webpage can handles a lot more interactions with the user before having to reach out to the server than a DHTML-based webpage.  Still, the delay is noticeable enough to affect user experience.

Third, browser integration problems with full Flash-based webpages are still there.  For example, pressing the Browser's Back button will not work properly.  There are other similar issues that must be addressed soon.

There is much I like about Laszlo, particularly the power of LZX.  LZX's extensibility is impressive.  I need to spend a few more hours later to look deeper under the hood, but what I like about Laszlo are these:

  1. Harmonized with Java-based web applications – you write your backend in Java and drive Laszlo using LZX tags from JSP.  This allows you to leverage your existing investment in Java.
  2. Smart use of Flash – you still need Flash to generate graphics and animation resources used by LZX tags.  This means Flash developers in your team can focus on what they know best.
  3. Good People – I am impressed by the talents behind Laszlo.

[Sorry about the shitty diagram.  I could have used Visio, but I also needed more lazy learning time with GraphViz.  Since I still don't know enough about dot to generate good looking diagrams, result is what you see above.]