Re: Refactoring a Swing GUI

From: Daniel Parker (danielaparker_at_spam?nothanks.windupbird.com)
Date: 11/26/03


Date: Wed, 26 Nov 2003 08:42:00 -0500


"Harry Erwin" <herwin@theworld.com> wrote in message
news:1g50xrp.1jqavxp9qukaoN%herwin@theworld.com...

> 1. The user interface looks like an airplane cockpit. I'd _like_ to make
> elements of the UI appear and disappear on command. For example, I have
> a list of elements displayed. I'd like it to show only the currently
> defined elements, with an additional blank element that I can fill in.
> I'd also like to be able to clear existing elements and have them just
> go away. Unfortunately, the elements contain heterogeneous data, so the
> standard tools are hard to use for this.
>
> 2. The coupling between M, V, and C is far too strong.
>
> 3. The code to put up any individual element of the UI is inelegant,
> especially with the need to define event handlers for every detail. I
> use inner classes a lot, but it still ends up with pages of code.

I think you need to do some design work. Look at what you have, what you
want to have, and model the latter. Then look at the gap between what you
have and the model, and refactor accordingly in samll steps.

Regards,
Daniel Parker