• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Class Size

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 1044
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Always look on the bright side of life. At least this ad is really tiny:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic