More Java posts
September 15, 2002
Wither Swing

Some comments on O'Reilly Network: Another Take on Swing and Java's Success. I'm the "one of the reader comments" mentioned at the top of the article for my remarks at the bottom of O'Reilly Network: The Success of Java.

I agree that having a common GUI api for both desktop and web work is doable. After all Microsoft seems to have almost done it. However, I don't think that starting with Swing is necessarily the best idea, it's too complex.

In my opinion the first thing is to decide on the sort of app that's being targeted. Swing lets you build pretty much anything and has functionality, like the paint method, that would be very difficult to implement in a web setting. If the focus is tightened to just "business style" apps then the problem is more tractable. Maybe the system should be built from the other end, would it be possible to implement the struts api on the client?

With struts the biggest problem for client implementation is the use of HTML for the views. This would have to be changed. Here XUL could be useful for describing an abstract layout which would be used to autogenerate appropriate HTML and Swing layouts. Some sort of overriding scheme to allow replacement or enhancement of the generated UI would have to be provided, you can never always generate exactly what's wanted. Fortunately CSS should provide nearly all of the look and feel customization needed for HTML, and for Java suitable overrides of the generated code by subclasses could let the developer tune the appearance.

The ultimate would be to come up with a way to allow the client app to take advantage of the increased capabilities that reduced latency and so greater interactivity gives it. How can the two models of interaction, screen at a time vs field by field, be reconciled, or at least accomodated in a single framework.

I agree with Marc that GUI framework development requires the internal and external consistency that best comes from a strong focus. For most open source or free software projects this is most often best provided by a strong leader. Especially in projects where there is the perception that this is a chance to build a better mousetrap it's important to have some way to ensure that people are all working towards the same mousetrap.

Posted by Alex at September 15, 2002 09:51 PM
Comments
Post a comment
Name:


Email Address:


URL:


Comments:


Remember info?