Wednesday Jun 25, 2008

Metadata Tagging with GWT

Starlight, that big ol' system of different parts that powers Sun.com, is pretty reliant on metadata.  Inside Starlight, a document such as a  product page is completely meaningless without at least some basic metadata; the type of document it is, its creation date, expiry date, content type, title, keywords... All that good stuff that allows us to derive information about a document without having to actually read/process/parse it.  Within Starlight, a document doesn't really exist unless it's both on the filesystem and in the database in the form of metadata.

This kind of metadata allows us to do cool stuff like automatically generate breadcrumbing from an indicated page hierarchy; render links differently based on content type, or expire old pages without administrator intervention. 

The options for doing cool things, however, dramatically expand when you introduce swoRDFish metadata.  swoRDFish provides a set of taxonomies, giving us access to UUIDs that uniquely (obviously) identify taxonomy nodes.  We describe many things with swoRDFish; the product hierarchy, web content types, country codes, industries... All of these help us to make dynamic linking between related documents possible (and thanks to our back end web application, rather easy).  Kristen blogged about this recently, within the context of the Customer Reference Index.

So how do we allow publishers to choose the swoRDFish UUIDs they are interested in for a particular document?  Metatagger is our swoRDFish metadata tagging tool, and it's been around since pretty early on in the Starlight days.  In it's original form, Metatagger's server side generated an entire JavaScript tree representing each taxonomy; this made is quite slow to start up.  In the six months or so, we've been redeveloping Metatagger - to improve performance, and to give it a much needed boot into the Web 2.0 era.  And as with any Web 2.0 application, the new version makes extensive use of AJAX.



Now, personally, I hate JavaScript.  I really do.  I hate that the implementation of the DOM differs between browsers and I hate that as a developer, you have to spend so much time compensating for browser quirks.  Another developer in our extended team had been working with GWT for another application, so we decided to expand on our use of it and use it to rewrite Metatagger.

As much as I hate JavaScript, I love GWT.  I'm a Java programmer by nature, and much prefer writing Java to JavaScript.  The fact that (by and large) GWT handles all the browser quirks for you when it compiles your Java down is fabulous.  And as I used to dabble in Swing, the fact that GWT interface programming is very similar to Swing fills me with joy (well, as much as interface programming can).

I was lucky enough to attend the GWT conference in San Francisco last year, and saw some truly amazing applications built with GWT:

Lombardi Blueprint
Timepedia Chronoscope

Although it's an app on a much smaller scale, Metatagger is particularly well suited to GWT because of the nature of the data it displays.  A node tree has many available paths for the user to explore (hundreds in the case of the UPT, the product taxonomy).  But what percentage of these are likely to be explored during a session?  Not a particularly high percentage; most users select only a few UUIDs, exploring only a few paths.  By using GWT, we can exploit the asynchronous-ness and load in path data as we need it.  In fact, we can load in whole taxonomies only as they are required.  This saves us load time and reduces the amount of data transmitted across the network.  And because it's all AJAX, there's no need for submit buttons and page refreshes.

So, if you're interested in AJAXian application development without the headache of getting involved in JavaScript, give GWT a try. 


Comments:

Post a Comment:
Comments are closed for this entry.