• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Class Size

 
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
 
Rancher
Posts: 1041
6
  • 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.
 
Bartender
Posts: 10777
71
Hibernate Eclipse IDE 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!
 
Evil is afoot. But this tiny ad is just an ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic