Stayin' alert:: moulding failure and exceptions to your needs

  • Authors:
  • Anya Helene Bagge;Valentin David;Magne Haveraaen;Karl Trygve Kalleberg

  • Affiliations:
  • University of Bergen, Norway;University of Bergen, Norway;University of Bergen, Norway;University of Bergen, Norway

  • Venue:
  • Proceedings of the 5th international conference on Generative programming and component engineering
  • Year:
  • 2006
  • Preparing for C++0x

    Companion to the 23rd ACM SIGPLAN conference on Object-oriented programming systems languages and applications

Quantified Score

Hi-index 0.00

Visualization

Abstract

Dealing with failure and exceptional situations is an important but tricky part of programming, especially when reusing existing components. Traditionally, it has been up to the designer of a library to decide whether to use a language's exception mechanism, return values, or other ways to indicate exceptional circumstances. The library user has been bound by this choice, even though it may be inconvenient for a particular use. Furthermore, normal program code is often cluttered with code dealing with exceptional circumstances.This paper introduces an alert concept which gives a uniform interface to all failure mechanisms. It separates the handling of an exceptional situation from reporting it, and allows for retro-fitting this for existing libraries. For instance, we may easily declare the error codes of the POSIX C library for file handling, and then use the library functions as if C had been extended with an exception mechanism for these functions -- a moulding of failure handling to the user's needs, independently of the library designer's choices.