Re: Exception handling and logging.
- From: "David Levine" <noSpam12dlevineNNTP2@xxxxxxxxx>
- Date: Wed, 25 May 2005 05:02:59 -0500
"Roger Down" <roger-down@xxxxxxxxxxx> wrote in message
news:OFzglGQYFHA.2996@xxxxxxxxxxxxxxxxxxxxxxx
>I have a question regarding exception handling and logging.
>
> First let me explain the situation.
>
> I am creating a .NET library with functionality that I am giving to
> another team developer. This other developer does not want to be bother
> with all sorts of exceptions from me, but only wants "controlled" return
> codes/classes. This is because he wants to take action on whatever return
> code / class I return. Makes it easier.
This is the essential problem - the other developer wants to deal with .NET
code as if he was writing his app in C. Tell this other developer to deal
with exceptions because he really has no choice. Even if your module does
not throw exceptions, the entire framework does, as do other 3rd party
libraries.
>
> He want however me to log all exception to a common logging system.
You could do that, but then so can the main application. This really ought
to be handled in a global logging mechanism so that application itself can
set a logging policy. How is your module supposed to know where to log the
data to? If it can change, how is it configured? When should it be logged?
How is the user notified a problem occurred?There are many design questions
that ought to be addressed - a single component in the system usually does
not have enough context to make all the decisions.
> The other developer can now just check the return code from the
> SomeMethod() function.
>
Again, this is very bad practice with .NET code. It increases the liklihood
that an error condition will be missed or ignored.
.
- Follow-Ups:
- Re: Exception handling and logging.
- From: Roger Down
- Re: Exception handling and logging.
- References:
- Exception handling and logging.
- From: Roger Down
- Exception handling and logging.
- Prev by Date: Re: Messagebox.Show refresh
- Next by Date: Re: threads and datatables
- Previous by thread: Exception handling and logging.
- Next by thread: Re: Exception handling and logging.
- Index(es):
Relevant Pages
|