Click here to Skip to main content
15,912,897 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
AnswerRe: Deisgn issues with Digital signature solution Pin
Code_Doctor16-Apr-07 17:24
Code_Doctor16-Apr-07 17:24 
QuestionSoftware Architect Pin
Mohammed Derbashi2-Apr-07 20:20
professionalMohammed Derbashi2-Apr-07 20:20 
AnswerRe: Software Architect Pin
Pete O'Hanlon3-Apr-07 1:10
mvePete O'Hanlon3-Apr-07 1:10 
JokeRe: Software Architect Pin
CPallini3-Apr-07 1:50
mveCPallini3-Apr-07 1:50 
AnswerRe: Software Architect Pin
Moak4-Apr-07 12:40
Moak4-Apr-07 12:40 
AnswerRe: Software Architect Pin
Aaron VanWieren4-Apr-07 13:16
Aaron VanWieren4-Apr-07 13:16 
QuestionEfficient Exception Bubbling Pin
Tristan Rhodes2-Apr-07 6:24
Tristan Rhodes2-Apr-07 6:24 
AnswerRe: Efficient Exception Bubbling Pin
Pete O'Hanlon3-Apr-07 1:19
mvePete O'Hanlon3-Apr-07 1:19 
Tristan

I think you have to ask yourself why you are rethrowing an exception so many times. Exceptions serve the purpose of allowing you to deal with a problem as soon as possible. The further up the trace strack you go, the lower the value of the exception becomes. For instance, suppose that I'm trying to open a file. If the file isn't present, I should expect to receive a FileNotFound exception. Now, this shouldn't bubble back up the chain because there is less that I can do with it at each stage back up the stack. What I should do is handle it at the point that the exception was first caught.

Now, why are you catching exceptions? Generally this is because you either want to be able to handle extraordinary conditions gracefully, e.g. don't attempt to read the file in if you receive a FileNotFound exception, or because you want to capture the fact that your code failed. In the first case, you want to handle the exception and move on. In the second case, you want to identify what happened where. Throwing it back up the chain isn't going to help you one bit in the second case. What you should really look at is implementing some form of logging mechanism and use that to log exceptions.

Finally - only rethrow an exception if there is value in doing it, e.g. by breaking the normal program flow to cater for exceptions.

Deja View - the feeling that you've seen this post before.

GeneralRe: Efficient Exception Bubbling Pin
Tristan Rhodes3-Apr-07 3:16
Tristan Rhodes3-Apr-07 3:16 
Questionwww.google.co.inestrict read/ write access to USB drive Pin
scoobydoo200729-Mar-07 23:14
scoobydoo200729-Mar-07 23:14 
GeneralRe: www.google.co.inestrict read/ write access to USB drive Pin
Paul Conrad23-Dec-07 8:18
professionalPaul Conrad23-Dec-07 8:18 
Questionrestrict read/ write access to USB drive Pin
scoobydoo200729-Mar-07 23:06
scoobydoo200729-Mar-07 23:06 
Questionbookkeeping agency Pin
alexrad29-Mar-07 10:04
alexrad29-Mar-07 10:04 
AnswerRe: bookkeeping agency Pin
led mike29-Mar-07 10:54
led mike29-Mar-07 10:54 
GeneralRe: bookkeeping agency Pin
alexrad29-Mar-07 13:42
alexrad29-Mar-07 13:42 
QuestionDoFactory.com Pin
Brendan Vogt29-Mar-07 1:13
Brendan Vogt29-Mar-07 1:13 
AnswerRe: DoFactory.com Pin
Pete O'Hanlon29-Mar-07 22:49
mvePete O'Hanlon29-Mar-07 22:49 
GeneralRe: DoFactory.com Pin
Brendan Vogt29-Mar-07 23:06
Brendan Vogt29-Mar-07 23:06 
GeneralRe: DoFactory.com Pin
Pete O'Hanlon29-Mar-07 23:22
mvePete O'Hanlon29-Mar-07 23:22 
GeneralBase Classes and Factory Pattern Pin
Brady Kelly27-Mar-07 19:26
Brady Kelly27-Mar-07 19:26 
GeneralRe: Base Classes and Factory Pattern Pin
Pete O'Hanlon27-Mar-07 22:40
mvePete O'Hanlon27-Mar-07 22:40 
GeneralRe: Base Classes and Factory Pattern Pin
led mike28-Mar-07 5:54
led mike28-Mar-07 5:54 
GeneralRe: Base Classes and Factory Pattern Pin
Brady Kelly28-Mar-07 6:10
Brady Kelly28-Mar-07 6:10 
QuestionGenerate C# code from UML class diagram Pin
aminowest27-Mar-07 5:07
aminowest27-Mar-07 5:07 
AnswerRe: Generate C# code from UML class diagram Pin
Fatbuddha 112-Jun-07 23:35
Fatbuddha 112-Jun-07 23:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.