Java Programming: Any Ideas for breaking a huge class file into smaller ?

Hello Java pros,
I have some very huge class files, some with dozens of methods; each method containing an average of a screen-page full of code.
Obviously, such huge class files are difficult to maintain inspite of using an IDE, especially when changes have to be made to a bunch of a category of methods scattered all over the class.
I am wondering if there are ways/best-practices out there to make the core class file smaller/smarter - fr eg.
<a> by retaining the real core definitions within the core class and moving the detailed implementation outside the core class
<b> by breaking down the file into more manageable pieces - something to the effect of using 'include' files that some languages support
etc.
Thanks for your help in advance.
Sree Nidhi

If you have huge class files with dozens of methods, maybe the design of your application is not so sound. You could use all kinds of OO design techniques to design your application so that it is easier to maintain.
Start by learning about design patterns. The most famous book about design patterns is this one: http://www.amazon.com/exec/obidos/ASIN/0201633612/qid=1029971487/sr=2-1/ref=sr_2_1/102-4299125-5141710
Here is also a nice book about anti-patterns: http://www.antipatterns.com/
Jesper

Similar Messages

  • How do I break up a pdf file into smaller files?

    I have a huge pdf file that I am trying to send as an attachment but it is too large to send.  I need to break it up into about 10 different files.  Any help would be appreciated.

    Hi sbills04,
    To split a PDF (or extract pages), you need to use Acrobat. Please see https://acrobatusers.com/tutorials/how-to-break-a-pdf-into-parts
    Please let us know if you have additional questions.
    Best,
    Sara

  • Any ideas for a (fairly) simple program?

    Does anybody have any ideas for a fairly simple program that I could try to write (I am a fair programmer, but I'm not to creative)?

    You know, Java Game Programming for Dummies is actually a pretty good book (despite the "Dummies" part!) It is written in 1.0, but it has a "ponglet", card games, and several maze games. All the applets I've tried from them actually work (some typos in the book itself, but the CD is ok). Any of these could be "starter" code.
    Yahoo has a whole bunch of Java applet games. You could try to reproduce pieces of the games you see. (These are also interesting in the sense that you can immediately see what works in a game and what doesn't.)
    It is always fun to write little components. Cool buttons (write a nice little non-rectangular button that lights up or something), text boxes that look like digital displays, funny text labels (maybe with a weird font or with letters that jump all over the place when you mouse over them).. These don't take a whole lot of time to write, but write them well and they are very useful for your future games.
    Enjoy!
    :) jen

  • When I watch tv shows in Front Row that I've bought off iTunes the audio gradually falls out of sync with the video. It does not happen with other files that I have converted into mp4s. Any ideas for fixing this? It's a huge bummer...

    When I watch tv shows in Front Row that I've bought off iTunes the audio gradually falls out of sync with the video. It does not happen with other files that I have converted into mp4s. Any ideas for fixing this? It's a huge bummer...

    I too have the same problem.  The audio drop out of sync in about 5 sec in not uncommon for the audio to be 30+ sec behind video.  Apple needs to fix this!!!!!!!!!!!!!!!!   its a joke,  my iphone is all messed up after the last update as well.  at one time not to long ago apple products and software were top rated, not so much any more, more and more problems are showing up and apple is unwilling or unalbe to fix the many issues.  Apple needs to fix the audio sync problem, it not the computer hardware or other software it ITUNES!!!!,  there is no workaround other then hitting pause and hitting pause and hitting pause to temp fix the problem. 

  • Not able to run the Java Program from jre for the ARM processor

    Hi ,
    I am try to run the jre1.4.2 for the arm core (linux 2.6kernel) which i downloaded from the sun site.
    I am created the class file from the J2SE1.4 development kit. I created the simple HelloWorld Program and complied with J2Se then i copied that class file into my IMX board which has ARM core.
    When i run the commnd java HelloWorld i am getting this error
    dl failure on line 765Error: failed /dev/shm/jvm/j2re1.4.2/lib/arm/client/libjve
    Please give me some suggestion to solve this porblem
    Thanks in Advance
    Narendra

    I JRE i have download from the sun site . But when i am trying to run the simple helloWorld program in that it is giving the below error.
    error:
    dl failure on line 765Error: failed /dev/shm/jvm/j2re1.4.2/lib/arm/client/libjvm.so because /dev/shm/jvm/j2re1.4.2/lib/arm/client/libjvm.so: symbol __divdf3, version GCC_3.0 not defined in file libgcc_s.so.1 with link time reference.
    Can anybody help me in this how to solve this problem . I also searched in the forum but did not get any answer on that problem
    Thanks in advance.
    Narendra

  • Every time I try to export or publish my project it result in a error and closing de program, any idea ???

    Every time I try to export or publish my project it result in a error and closing de program, any idea ???

    Hi,
    That link takes you to the Facebook for iPhone app.
    You have posted in the Mac App Store for Mac OS X. (I know it's somewhat confusing especially with the new forum format).
    Try deleting the Facebook app from the iPhone by pressing down on the app on the iPhone until it jiggles then tap the circle with an x in it. Then tap the Home button to stop all the apps from jiggling.
    Now tap the App Store icon and and re download the Facebook app again.
    If that doesn't make a difference, post over in the iPhone Discussions forum at this link.
    https://discussions.apple.com/community/iphone/using_iphone
    Carolyn 

  • Pc is not recognising PDF file ( icon ) in emails and to open these it is loading a 3rd party program on the web. I have installed Adobe several times. To open my files I need to drag them to my Adobe program. any ideas??

    Pc is not recognize PDF file ( icon ) in emails and to open these it is loading a 3rd party program on the web. I have installed Adobe several times. To open my files I need to drag them to my Adobe program. any ideas??

    Hi aadeshs
    This problem is on my laptop  running Vista ( Business) on Adobe 10.0  ,   for many years I did NOT have a problem with this . No forum Pages on this. 
    Also i would like to know how screen readers can better interact with PDF as my wife has difficultys on some email attachments on her laptop , again there seems no easy avenue for someone in her situation surfing websites and forums  for Hours maybe ok ok for sighted people, but not if you are blind & use a screenreader.  No Support Help from Adobe is available.
    thanks
    oliver654837

  • In Office 2011 the function "share it by e-mail" seems to be disabled. that happened recently, just after the apple update regarding Java. Any idea on how enable this function again?

    in Office 2011 the function "share it by e-mail" seems to be disabled. that happened recently, just after the apple update regarding Java. Any idea on how enable this function again?

    I was able to get to a support person who helped me fix this without charge. I guess it was my bad for not trying the right way to access support.
    Anyway, they answer is this.
    I had to create a new account on my computer. When I logged into the new account it immediately wanted an AppleID. I used my daughter's e-mail address for the AppleID. This setup the internet accounts correctly with her iCloud.com e-mail address. I was then able to access e-mail in both the browser and Mail. Not that complicated but nothing that I would have easily thought up on my own.
    Thank Apple Support!

  • TS1362 Everything works except the **** thing won't play. I push the play arrow or instruct it to play and it stays eternally paused. No problem buying things from these dogs,just can't play the when everthing pops up on screen.Any ideas for a hopeless ol

    Everything works on ITunes except play function.I can select as song I want but cannot get it off "pause."I tried going to controls and instructing it to play(no go) and clicking again and again on play arrow(which flips it to pause...).Any ideas for a very old,very frustrated non-tech guy???
    Please!! Thnaks!!!

    Replying to myself. Kept trying different areas of the ipod this evening, clicking various buttons, including some I'd never used before. All of a sudden I could see my Nano in iTunes. I quickly clicked on Restore before iTunes changed its mind about recognizing the iPod. Moved some songs onto it and it appears to be back to normal.  Keeping my fingers crossed. 

  • HT1384 My ipod nano 3rd generation, when connected by usb, does not show up in itunes, does not show up on my computer, does not seem to charge by the wall charger. It just has a black screen. Any ideas for me?

    My ipod nano 3rd generation, when connected by usb, does not show up in itunes, does not show up on my computer, does not seem to charge by the wall charger. It just has a black screen. Any ideas for me?
    I've run diagnostics. Can't find device. I've tried resetting. The toggle has been turned on and off.

    Cable works fine on my other iPod. Reset by pressing menu and center button together for 6-10 seconds. Left it to charge for many hours. Started acting up while running. Suddenly the music stopped playing but my Nike + was still working for the rest of my run. Took it straight it home and plugged it in to the wall to recharge since the battery was fairly low. Looked like it recharged ok but then screen went blank and now does it not show up on iTunes, does not seem to recharge by the wall charger (apple wall charger plugged into a surge protector in India). I have turned the hold switch off and on many times.
    Sounds like a repair issue, which is not easy to do in India :(

  • I bought an eBook from iTunes. I can view/read it perfectly on my iPhone but when I try to open the eBook file on my iPad, I get the error message, "Cannot open book. This book is protected by an incompatible technology." Any ideas for me? thx

    i bought an eBook from iTunes. I can view/read it perfectly on my iPhone but when I try to open the eBook file on my iPad, I get the error message, "Cannot open book. This book is protected by an incompatible technology." Any ideas for me? thx

    Welcome to the Apple Community.
    I have seen previous versions mentioned in a pop up message before on iCloud.com, but I'm not really sure at all how it would help, as I couldn't get it to do anything.
    The best advice I have at this time is to back up your work on your iOS device by regularly saving it to iTunes, if anything goes wrong you can then either load it into the numbers app again on the device or recover it via iTunes on your computer.
    My syncs are immediate, I never get chance to see if it works in the background, sorry.

  • My source audio isn't importing. Any ideas for how to fix?

    The audio is there. I've watched it in VLC, and the audio is there. Whenever I import the footage, though, it goes missing. Any ideas for how to fix it?

    Welcome to the forum.
    First, more information would be useful. See this FAQ Entry for what info will help: http://forums.adobe.com/thread/961741?tstart=0
    Also, when you Import your AV file, do you allow PrPro time to Conform the Audio portion? For more info on Conforming, Indexing and PEK file creation, see this article: http://forums.adobe.com/message/3892177#3892177
    Good luck,
    Hunt

  • Any ideas for a Birthday wishes video????

    Howdy folks,
    Thanks for taking a peak at this post. No technical problems--as of yet, but just wanted to hear from the crowd on some creativity with the apps.
    Any ideas for a background/slate to place behind people giving their best wishes to the birthday-boy?
    Editing on FCP, access to all of the CS applications--any thoughts on the matter would be appreciated.
    Thanks again for your time and have a great day,
    Liza

    Wow Bob,
    I can see that cowboy lasso/rope spinning on the top your head, but... watch out, I think you arm just hit your hat off your head... friendly.

  • I updated the software on my 2009 MBP to Mountain Lion. Since then, my iPhoto has been unable to open my photo library. I have updated iPhoto, and still no luck. Any ideas for fixing this problem?

    I updated the software on my 2009 MBP to Mountain Lion. Since then, my iPhoto has been unable to open my photo library. I have updated iPhoto, and still no luck. Any ideas for fixing this problem?

    Welcome to the Apple Support Communities
    Do you see any message when you open iPhoto? Try to open iPhoto holding Option key and select the library

  • HT201210 I am trying to download the latest version of itunes and it comes up error 3014 and error -1.  Any ideas for help?

    I am trying to restore my apple and update it.  It comes up error 3014 and -1.  Any ideas for help?

    Try the following user tip:
    Troubleshooting issues with iTunes for Windows updates

Maybe you are looking for

  • Transferring songs from PC to Itunes. HELP!

    I put songs from PC files onto a flash drive and put them into the Itunes Library. It looked like it worked fine until I tried to click and drag them to a Playlist. For about half the songs, an exclaimation point appers next to the song and I get a m

  • Connectivity issue to database.

    DB Version :10.2.0.2 OS:Sloaris 5.8 Yesterday the application server couldn't able to connect to the production database for 30 min .When i checked in the alert log ,i got primary unable to ping the standby database LGWR: I/O error 3113 archiving log

  • Connecting to mysql on another cfserver

    I have two cf servers. 1 a 7 and 1 a 8. I want to connect the CF8 server to a mysql datasource on the CF7 server I have listed the Database, Server by ip (numbers and . only) port user and pw Connection verification failed for data source: ldiline137

  • Automation of OBIEE 11G services in Windows OS

    Hi I had put in lot of effort to find a way to automate the OBIEE 11G services in Windows OS whenever the system reboots but to no avail. Any workaround to achieve this would be very helpful and greatly appreciated. Thanks

  • PSE11 and 12 will NOT display a JPG i open..... this just occured- have no idea why - please help??

    PSE11 and 12 will NOT display a JPG i open..... this just occured- have no idea why - please help??