Linux Today Article Recommends Sun Adopt XUL for Java
Friday February 27th, 2004
Tomas Marek (marek<AT>tipsport<DOT>cz) and guzzi333 pointed us towards a Linux Today article in which Ganesh Prasad argues that Sun should levarage the work of the open-source community to improve enterprise Java and fight back against Microsoft's .NET. The author singles out client-side rich user interfaces as an area in which Java is weak, and recommends that Sun adopt XUL to fill the gap. This would help to combat Microsoft's XAML technology, which is similar to XUL and designed to work well with .NET applications. Prasad also claims that Sun could give credibility to XUL and encourages the company to work with the Mozilla Foundation to get the language endorsed as a W3C standard.
I do think it would be worth Sun supporting an XML-based interface language - creating interfaces in code is good as an option but shouldn't be required, and then there are too many idiots who use IDE tools that write REALLY REALLY BAD interface code for them using shitty semi-GUI interface builders... java source code is really not the right place for autogenerated interface data to go...
But I don't think there's any particular reason why it should be XUL. After all, XUL:
1. is not a W3C standard 2. is not used outside Mozilla (ok, except by a few crackpots, see above part of thread, but I'm not aware of any significant, large-scale projects other than the Mozilla-related ones) 3. isn't a natural match for existing Swing components
Seems to me that it would be fairly easy to create an XML-based interface language built on the existing Swing components via Java Beans. This would provide developers with an easy way to create existing Swing components. In fact can't you already serialise beans to XML...? Not sure this would handle the 'code' issues (embedding code, rather than just describing layout) but...
Incidentally on saturday I actually developed xml support for my own java layout stuff I'm doing (this is just for my own program). It's trivially easy to make xml files represent java layouts, I think it took me less than an hour to plug in xml 'layout creation' support to my framework [again, this doesn't have embedded code], but I agree there ought to be a standard built-in way to do it for all JavaBeans components (including Swing), with IDE support and so on.
I sort of worry that a standard built-in way would be overly verbose and complex if Sun come up with it but, eh. :) I haven't looked at the XUL spec so maybe that is already overly verbose and complex...