@MISC{Meyer88disciplinedexceptions, author = {Bertrand Meyer and Software Engineeering}, title = {Disciplined Exceptions}, year = {1988} }
Bookmark
OpenURL
Abstract
One of the most delicate problems of software construction is the handling of abnormal situations. How can a programmer write robust software components, which will take care of all possible cases, without impairing the elegance of the structure and the processing of normal cases? This paper presents the solution recently introduced into the Eiffel object-oriented language and environment for dealing with unexpected run-time situations. The solution is entirely follows from the principles of Design by Contract (TM); it is based on the idea that a "failure" is the inability for a routine or other operation to fulfill its contract, and an "exception" is an abnormal run-time event that may cause a failure. Any attempt to recover from the exception, as well as any acceptance of the failure, must be compatible with the contract, in particular the invariant of the class. The "rescue"-"retry" mechanism follows from this systematic analysis.