Skip to main content

Tomorrow's Webtop Application

Posted by jhook on September 5, 2005 at 10:59 AM PDT

Let me give you a hypothetical project that involves two groups. One group develops a thin client, that is delivered over the web. This thin client works in conjunction with a fat, installed client that the other group developed. The first beta hits, both groups have a couple kinks to work out. The thin client group makes their changes from their cubicle and tells the beta customer to refresh their screen. Done. The fat client group is in for a much more difficult change and has to repackage and send a new CD out to the beta client. That might not even solve the installation issues. Fast forward months later. The beta customer wants a new feature. For the thin client group, they can just add it and have it 'deployed' instantaneously to their customers. What about the fat client? How versatile was their solution long term?

A web page isn't always going to work out for thin client development, but you have a large web-development team that isn't experienced with Swing/SWT based development. Where do you go with the most knowledge transfer? Start looking at webtop solutions such as XUL.

Webtop Solutions?

XUL works exactly like a web page, except that it's markup is representative of a desktop application. Developers can use all of their familiar JavaScript/DOM skills within a browser environment to handle menus, toolbars, sortable tables and trees, etc.

Deployment

Deployment wise, XUL is the foundation of Mozilla's product platform. Firefox, Mozilla, and Firebird are written in or use XUL. To think for a second, all of the different platforms that run Mozilla's product line could also run your webtop application.

You may also reference resources online just like you would a web page-- import CSS information and JavaScript files, along with RDF data and JPGs or GIFs. Here's the kicker, you can mix HTML and XUL together in a single document too!

XUL Example

<?xml version="1.0" encoding="UTF-8"?>

<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>

<window id="example" title=Example"
        xmlns:html="http://www.w3.org/1999/xhtml"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        style="background-color: #fff;">
<toolbox>
  <menubar id="menubar">
    <menu id="view-menu" label="View">
      <menupopup id="file-popup">
        <menuitem label="New"/>
        <menuitem label="Open"/>
        <menuitem label="Save"/>
        <menuseparator/>
        <menuitem label="Exit"/>
      </menupopup>
    </menu>
  </menubar>
</toolbox>

<tree rows="6" flex="1" style="margin: 0;">
  <treecols>
      <treecol id="firstname" label="First Name" primary="true" flex="3"/>
      <treecol id="lastname" label="Last Name" flex="7"/>
  </treecols>
  <treechildren>
    <treeitem container="true" open="true">
      <treerow>
        <treecell label="Guys"/>
      </treerow>
      <treechildren>
        <treeitem>
          <treerow>
            <treecell label="Bob"/>
            <treecell label="Carpenter"/>
          </treerow>
        </treeitem>
        <treeitem>
          <treerow>
            <treecell label="Jerry"/>
            <treecell label="Hodge"/>
          </treerow>
        </treeitem>
      </treechildren>
    </treeitem>
  </treechildren>
</tree>
</window>

Dynamic XUL

XUL does a nice job of separating presentation, structure, and behavior; more so than HTML. To provide dynamic data and behavior, you may use RDF technology which would be like writing a bunch of AJAX code to interpret/use XML data to manipulate the HTML DOM stucture, except all you need to do is point at the RDF data source and everything is take care of. If the data changes, just tell that RDF data source to refresh itself via JavaScript and you're done.

There are places where RDF isn't what you need and you want server-side DOM manipulation. For this, you could use technologies like JSPX, JavaServer Faces, or Facelets which are markup agnostic. Roger Kitain, JSF co-spec lead, co-published an article at java.sun.com on using XUL, HTML, and SVG at once within a component-based application.

Moving Forward

When would you want to use a webtop application and how are you going to get there? Just like your customer/company would be required to have Java installed to run your application, installing Mozilla isn't too far fetched. Install Mozilla and point your browser [here] to use your live application.

When you are dealing with interactive, tabular/spreadsheet data, it might be a good idea to seriously consider a webtop solution with XUL. For those who don't want a desktop look, you can always use CSS to make the background a different color or make the buttons red or bold some text. It really is a win-win situation if you can get around supporting IE.

Again, since there's tons of knowledge transfer from web development to webtop development with XUL, your team can continue to be higly productive. Also, you can use familiar frameworks such as JavaServer Faces to deliver your application to the browser.

This blog was spurred on by reading Jonas Jacobi's entry on Rich Internet Clients (who made much more intelligent points ;-).

Related Topics >>