Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

use code generators or not  RSS feed

 
Nikos Stavros
Ranch Hand
Posts: 243
Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've just finished a beta version of a program and I've spent a lot of company time manualy writing code for a swing GUI. The GUI still has some non nicities but it works. I'm considering changing to a GUI builder to build these things, but may try and do it manually for a bit longer.

WHat do you people think
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I always handcode my GUIs, and find that with some care, there are a lot of opportunities to reuse code. Basically with the time, we build a small but powerful domain specific GUI framework that's exactly is fitted to our needs.

It's a little bit more work up front and needs some experience to do well, but I don't think that it can be beat buy a GUI builder for anything but the simplest project. Your mileage may vary...
 
Tim Holloway
Bartender
Posts: 18774
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not well-organized enough to manually track GUI components for hand assembly. OTOH, I've yet so see a GUI code builder for Java that didn't cheat and slip in some proprietary classes and often build some pretty dumb code at that.

The way I got around it was to use the Visual Cafe GUI builder (remember Visual Cafe? Circa Y2k?). It produced the GUI for me, but with the usual vendor slop in it. Then I ran the generated code through a Perl script I hacked out that converted the vender-specific code to generic Swing code and got rid of the logical that was totally brain-dead (It also converted absolute gridbaglayout code to relative code so it would be easier to hand-maintain).

I haven't done this lately. I think Visual Cafe can still be made to work, though. If not, the same tricks can be applied to many of the newer Swing code generators.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!