I have a virtual base method void Action() that is overridden in a derived class.
The first step in Action is to call base.Action(). If a situation occurs in the base method I do not want the rest of the derived method to be processed.
I want to know is there a keyword or design pattern that will allow me to exit the derived method from the base method.
Currently I am looking at changing the void to bool and using that as a flow control, but I was wondering if there are any other design patterns I might be able to use.
Do not use it with
voidreturned type, but can do, sayboolOr, if this is a exceptional situation, raise an exception, like others suggest.