Implementing reusable exception handling patterns with compile-time metaprogramming

  • Authors:
  • Yannis Lilis;Anthony Savidis

  • Affiliations:
  • Institute of Computer Science, FORTH, Greece;Institute of Computer Science, FORTH, Greece,Department of Computer Science, University of Crete, Greece

  • Venue:
  • SERENE'12 Proceedings of the 4th international conference on Software Engineering for Resilient Systems
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

We investigate in depth the adoption of compile-time metaprogramming to implement exception handling patterns. It is based on logic that is executed at compile-time and outputs source fragments which substitute the meta-code before compilation. Exception patterns are realized as metafunctions capable to transparently generate the invocation details and the appropriate exception handling layout. This way, programmers are relieved from underlying exception handling details, while the handling patterns can be standardized and directly reused. Pattern libraries of directly editable code are enabled, while the adoption of compile-time metaprogramming allows configuring the pattern deployment within the original client source based on application requirements. We examine key exception handling scenarios and we implement them as configurable and reusable pattern libraries in an existing meta-language.