From: Christian C. <chc...@cl...> - 2001-05-29 04:45:58
|
Eric Bezault wrote : > > Berend de Boer wrote: > > > > Have you other solutions or suggestions? As exception raising is done > > in just one place it's easy to change into an option or something > > elese. > > Could the use of exceptions or error variables be parameterized, > for example use different creation routines if I want operations > applied to this object to raise exceptions or set a boolean > attribute when an error occurs? Well, an other solution could > be to have two sets of routines, one with exceptions and one > with an error status boolean to be set on error. This latter > solution has the advantage of possibly providing slightly > different postconditions for the two sets of routines. I would rather have a base class using error variables and a derived class (inheriting the base class) with exceptions. Or something like this. I think it's far better than two set of routines (doing essentialy the same thing) in the same class. Regards, Christian. |