By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,180 Members | 1,065 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,180 IT Pros & Developers. It's quick & easy.

Process flow managament?

P: n/a
Hi,

I've been trying to find the best way of controlling the logic flow within
C# and have found lots of conflicting information. Few ways seem to be:

- passing back values to calling methods
- using rethrows
- using boolean

For example I may be doing something like:

Starting Main method which processes a file and passes each line into
Method1
Method1, accepts each line as a string parameter and acts on it. This may
be doing SQL lookups via a SQL method (SQLMethod1), checking AD via
ADMethod1 etc etc

Basically what I'm trying to find is the "best" way to catch problems in
this type scenario where a failure could occur in any method (for example
ADMethod1) and this should pass up into Method1 and ulitimately back to the
Main method. So if a particular entry in a file causes some sort of
failure, the main method should detect this, log it and carry on processing
subseqent lines (and not terminate at that point).

Also, in VBScript I could also use Exit Function to exit a function early on
the detection of the failure, how are most people handling this in C#?

Thanks for any help.

Nov 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.