We have started new project and I need to design the application. I was thinking, what is the best design we can choose to meet the utmost performance requirement along with robust exception handling. If you have any info, pl pass it on.
Did I understand you right? You just asked, "how can I make a good design, and incorporate exception handling?" This is a really big question, and one that's not easy to answer. It's also not J2ME related. --Mark
Joined: Nov 07, 2000
Sorry, if I had asked for lots in one question. Here is what I'm looking for. Good exception design guidelines keeping performance in mind. For ex., don't throw many exceptions, always write the stack trace into the log etc... thanks
"Utmost performance" is not a reasonable requirement, because you can't say wether you have met it or not. Also, "utmost performance" inevitably comes with "utmost project costs", so it probably isn't what your client(s) really want(s). And even when you have a more reasonable requirement (such as "has to process xxx in less than yyy seconds", for example), remember the Three Rules Of Optimization: 1. Don't. 2. (for experts) Don't - yet. 3. (if you really need to) Use a profiler to find the bottleneck - it isn't where you think it is.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
e.printStackTrace() doesn't count as handling an Exception Maybe not, but (a) it's far better than catching an exception and doing nothing with it, which is what many novices end up doing, and (b) it's perfectly reasonable in addition to other actions. Logging exceptions doesn't preclude doing other things as well (including re-throwing the exception). And in any situation where you're not entirely sure yet what an appropriate response is, logging will at least give you ongoing reminders of what's really going on in your program.