• Post Reply Bookmark Topic Watch Topic
  • New Topic

Class Size  RSS feed

 
Dale Bradley
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a fairly simple Applet which i have finished (still figuring out how to get it to run in a browser, but i have all the functionality finished). It communicates with a database i have set up in MySQL. However, the class has a very large amount of lines and i just dont feel comfortable with the length. Its around 1400 lines.

I used windowbuilder in Eclipse for the GUI which takes around 700 lines. Its got multiple tabs and lots of buttons etc. Then i have around 18 methods which are basically get and set methods for the database. I have cut it down as much as i can in terms of redundant code. However, im just wondering if you gurus know how i can reduce the size?

Am i right in concluding that splitting up the GUI from my main applet class would cause a problems with accessing GUI components? The app constantly changes and updates the GUI with information from the DB.

I feel i understand OO concepts but because this is just a 'questionnaire' and nothing more, i am unsure on how to reduce the size. ANY info would be great!!

Thanks in advance
 
Ivan Jozsef Balazs
Rancher
Posts: 999
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dale Bradley wrote:I have a fairly simple Applet which i have finished (still figuring out how to get it to run in a browser, but i have all the functionality finished).


Without knowing the details only general pieces of advice can be given, but it is usually a good idea to break down the program into parts,
meaning not only methods but in the OO case also several classes. They can then be bundled into a jar.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dale Bradley wrote:Am i right in concluding that splitting up the GUI from my main applet class would cause a problems with accessing GUI components?

Not that I know of, but I'm no GUI expert. From what I understand, applets are a bit passé though.
I feel i understand OO concepts but because this is just a 'questionnaire' and nothing more, i am unsure on how to reduce the size. ANY info would be great!!

My advice would be to Google the MVC (Model-View-Controller) pattern.

Winston
 
Dale Bradley
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the speedy advice guys!

Im going to try and separate the GUI into a different class and look to bundle a few things together to break it up.

Again, thanks!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!