Wednesday, May 19, 2004

So there's another Swing debate going on at Java.net. AS one of the people posting points out there are many such debates going on all the time.

java.net: Swing Usability [May 19, 2004]

I guess I don't have that much of a problem with swing, see my comments on the matter.

What does amaze me though is how Java developers do seem to struggle with it. What does this say about the current state of the development community.

It is perfectly possible to create decent Swing apps, just check out the ones selected for Sun's Swing Sightings column. I'm really proud of our client application, especially since I didn't know any Swing before I started it. (I'll post a link to the demo as soon as it's up)

Swing is after all just an API to be used, it isn't that complicated, just big. Most Swing guides give an overview, but they focus on the MVC aspects of Swing. I suspect that this isn't quite how most Java developers will work. People very quickly break the MVC architecture, and that's not always a bad thing. The other side of this is that I know a lot of Computing graduates wouldn't have a clue what MVC is, which worries me even more.

So I'd like to share my 2 top practical tips, the things I learned in my adventures in Swing:

1) Develop your own components.

Do not be affraid to customise and aggragate components into something that is easily reusable for you. This will help you test at a lower reused level, and keep the look and feel of you application consistent if you reuse these components.

2) Build your own layout managers for anything slightly more complicated.

After I'd bitten the bullet and built my own layout manager for one very complicated component I didn't stop. Most all of the components that aren't simple containers now have their own layout managers.

I guess that's it. Only two tips for now, but they are just about the most important two that I learned.