NICE-ESG-Libs Digest Wed, 29 Nov 95 Volume 1 : Issue 310
Today's Topics:
Exceptions
NICE Eiffel Standards Group -- Library Committee Mailing List
To post to list:
NICE-ESG-Libs@atlanta.twr.com
To send mail to the Chairman of the committee:
NICE-ESG-Libs-chair@atlanta.twr.com
Administrative matters (sign up, unsubscribe, mail problems, etc):
NICE-ESG-Libs-request@atlanta.twr.com
Date: Wed, 29 Nov 1995 08:57:00 +0000 (GMT)
From: Paul Johnson +44 1245 242244
Subject: Exceptions
To: NICE-ESG-Libs
> With a class-based exception mechanism it might work like this:
> at the innermost level the LINK_GONE_DOWN exception might cause a wait then a
retry,
> before falling through to the next layer of exception handling which catches
the
> COMMS_ERROR exception (of which LINK_GONE_DOWN is a descendant) and attempts
> to re-establish a suitable alternative circuit, before falling through to the
next layer of
> exception handling which catches the IO_ERROR exception (of which COMMS_ERROR
> is a descendant) and causes the current database transaction to be rolled
back.
I'm not sure I understand this? Are you saying that the exception object
should contain the code for the exception handler? If so, then this implies
that the exception thrower knows what should be done. If not, then presumably
the handler has to do a series of reverse assignment attempts to figure out
what should be done. Integer values are a more efficient way of doing this.
I can appreciate Roger's problem with new types of exception. So how about
having a hierarchy of values stored in an array? The first level contains very
broad information about the type of the exception (e.g system vs application
exception). The second breaks down the broad class into a narrower one (e.g
system exceptions are broken down into precondition, postcondition, invariant,
OS signal). We might need something a bit more sophisticated than integers,
since a comms library is going to want its own hierarchy which does not collide
with anything else. Perhaps something could be done with once functions where
these values are assigned on-the-fly during execution.
Paul.

|
|