From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: *** X-Spam-Status: No, score=3.8 required=5.0 tests=BAYES_00,INVALID_MSGID, RATWARE_MS_HASH,RATWARE_OUTLOOK_NONAME autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,a48e5b99425d742a X-Google-Attributes: gidfac41,public X-Google-Thread: 1108a1,5da92b52f6784b63 X-Google-Attributes: gid1108a1,public X-Google-Thread: ffc1e,a48e5b99425d742a X-Google-Attributes: gidffc1e,public X-Google-Thread: 103376,a48e5b99425d742a X-Google-Attributes: gid103376,public X-Google-Thread: f43e6,a48e5b99425d742a X-Google-Attributes: gidf43e6,public From: "Gavin Collings" Subject: Re: Papers on the Ariane-5 crash and Design by Contract Date: 1997/03/21 Message-ID: <01bc3603$f9373d40$b280400a@gavinspc>#1/1 X-Deja-AN: 227279606 X-NNTP-Posting-Host: firewall2.sperry-sun.co.uk References: <332B5495.167EB0E7@eiffel.com> <332d95c9.1004852@news.demon.co.uk> <33307a43.1705970@news.demon.co.uk> <5gqsoe$bp1$2@news.irisa.fr> <333186ba.3456540@news.demon.co.uk> Newsgroups: comp.lang.ada,comp.lang.eiffel,comp.object,comp.programming.threads,comp.software-eng Date: 1997-03-21T00:00:00+00:00 List-Id: Niall Cooling wrote in article ... > This is where I like the Java model > where, if using a member function that may raise an exception, you must > either handle it or propagate it, you cannot just ignore it (I do not know > enough about Eiffel to comment). I wholly agree with you on the Java model. I believe Eiffel does not do much for you here. Although it does express relationships between post/pre- conditions and inheritance (which I don't think Java does), the only 'data' passed between client and supplier is a boolean (success or failure). Although this ties in nicely with the ideas expressed in OOSC, i.e. a routine should either succeed or fail, nothing else, it does limit the options for retry clauses in clients - who cannot distinguish between multiple modes of failure and are therefore usually in no position to "fix and retry". (In my opinion, querying the immediate supplier for lasterror does not work very well - especially as the exception may have been generated by a supplier's supplier...) Although I don't approve of using exceptions as a modified form of longjmp() I am attracted to the idea of catching exception objects based on their run-time type and I'm sure Eiffel is missing some semantic content here. Hopefully, there is an elegant way to combine the two approaches. raise( !!MyException.make() ); require/ensure ( BOOLEAN ) else raise(); rescue( e : MyException ); plus compiler support to detect un-rescued exception types ?? -- Gavin Collings gcollings@sperry-sun.com