G
Guest
If a form returns a dialog result and it can be handled immediately, then you
can just check for the result and proceed accordingly.
However, if the result of a dialog has to be returned from a deeply nested
method in the call stack to the original caller in the call stack, what is
the best way to do it?
I can think of a couple but I see major problems with them.
1. Throw an exception and catch it at the caller. Problem: Using exceptions
as control flow constructs is a bad idea. Exception handling is
computationally expensive.
2. Return the result from the top of the stack to the original caller, one
layer of the stack at a time. Problem: Hard to maintain with multiple many
return calls throughout the stack.
can just check for the result and proceed accordingly.
However, if the result of a dialog has to be returned from a deeply nested
method in the call stack to the original caller in the call stack, what is
the best way to do it?
I can think of a couple but I see major problems with them.
1. Throw an exception and catch it at the caller. Problem: Using exceptions
as control flow constructs is a bad idea. Exception handling is
computationally expensive.
2. Return the result from the top of the stack to the original caller, one
layer of the stack at a time. Problem: Hard to maintain with multiple many
return calls throughout the stack.