Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

My GUI

 
Keith Jones
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm starting from the gui and I have to say my gui is lame. The spec says that number of parameters we pass around must be reasonable and the gui must be extendable for the future and that the code must be understood easily by a junior programmer. My code on the otherhand doesn't follow any of these criteria; it's spagetti. I was wondering if someone could suggest some better ways of doing things:

1. I have a config gui class that contains a config frame class that contains a abstract config panel class that can be either a host info panel or a database file panel. Is this a good idea?
2. From my main class I pass 4 parameters to my config gui class (the mode [server, client, alone], the config mode [host, database], the object dealing with reading the gui properties [strings in the gui], the object dealing with reading and writing user properties [location of the database file and host info]). And of course since my gui HAS-A frame class which HAS-A panel class etc i have to pass these parameters onto these classes as well. Is there a better way?
3. I have a config handler class with implements ActionListener and this has to have all these parameters passed to it as well. I instantiate this from my main class. Is there a better way to design this?

I think I have chosen the worst way to design my solution.

Cheers
 
Mike Ngo
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Think of how other applications work... For ex, Firefox allows you to set the options under Tools/Options...

So you should have a menu with a menu item Config... Selecting Config... will bring up a Config Dialog. The dialog then can get hold of an instance of the object that handles application configuration (reading/writing from propeties file)
It seems like you have too many objects.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic