Skip to main content

Implementing Reusable Exception Handling Patterns with Compile-Time Metaprogramming

  • Conference paper
Software Engineering for Resilient Systems (SERENE 2012)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 7527))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 72.00
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Goodenough, J.B.: Exception handling: Issues and a proposed notation. Communications of the ACM 18(12), 683–696 (1975)

    Article  MathSciNet  MATH  Google Scholar 

  2. Doshi, G.: Best practices for exception handling (2003), http://www.onjava.com/pub/a/onjava/2003/11/19/exceptions.html (accessed May 11, 2012)

  3. McCune T.: Exception-handling antipatterns (2006), http://today.java.net/pub/a/today/2006/04/06/exceptionhandling-antipatterns.html (accessed May 11, 2012)

  4. Savidis, A.: Delta Language (2010), http://www.ics.forth.gr/hci/files/plang/Delta/Delta.html (accessed May 11, 2012)

  5. Bertrand, M.: Design by Contract. In: Mandrioli, D., Meyer, B. (eds.) Advances in Object-Oriented Software Engineering, pp. 1–50. Prentice Hall (1991)

    Google Scholar 

  6. Garcia, A., Rubira, C., Romanovsky, A., Xu, J.: A comparative study of exception handling mechanisms for building dependable object oriented software. Journal of Systems and Software 59(2), 197–222 (2001)

    Article  Google Scholar 

  7. Wirfs-Brock, R.: What it Really Takes to Handle Exceptions in Use Cases. In: Use 2002 Conference Proceedings, pp. 341–370 (2002)

    Google Scholar 

  8. Newton, K.: The Exception Handling Application Block. From. The Definitive Guide to the Microsoft Enterprise Library, pp. 221–257. Apress (2007)

    Google Scholar 

  9. Lerner, B.S., Christov, S., Osterweil, L.J., Bendraou, R., Kannengiesser, U., Wise, A.: Exception handling patterns for process modelling. IEEE Transactions on Software Engineering 36(2), 162–183 (2010)

    Article  Google Scholar 

  10. Kiczales, G., Lamping, J., Mendhekar, A., Maeda, C., Lopes, C., Loingtier, J., Irwin, J.: Aspect-Oriented Programming. In: Aksit, M., Auletta, V. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 220–242. Springer, Heidelberg (1997)

    Chapter  Google Scholar 

  11. Laddad, R.: AspectJ in Action. Manning 512 (2003)

    Google Scholar 

  12. Cole, L., Borba, P.: Deriving refactorings for Aspectj. In: Proc. of the 4th ACM Conference on Aspect-Oriented Software Development, Chicago, USA, pp. 123–134 (March 2005)

    Google Scholar 

  13. Laddad R. Aspect-Oriented refactoring, parts 1 and 2. The Server Side (2003), www.theserverside.com (accessed May 11, 2012)

  14. Lippert, M., Lopes, C.V.: A study on exception detection and handling using aspect-oriented programming. In: Proc. of the 22nd ICSE, Limerick, Ireland, pp. 418–427 (June 2000)

    Google Scholar 

  15. Castor, F., Cacho, N., Figueiredo, E., Maranhao, R., Garcia, A., Rubira, C.: Exceptions and aspects: The devil is in the details. In: Proceedings of the 14th SIGSOFT FSE, Portland, U.S.A., pp. 152–162 (November 2006)

    Google Scholar 

  16. Castor, F., Garcia, A., Rubira, C.: Extracting Error Handling to Aspects: A Cookbook. In: Proceedings of the 23rd ICSM, Paris, France (2007)

    Google Scholar 

  17. Greenwood, P., Bartolomei, T., Figueiredo, E., Dosea, M., Garcia, A., Cacho, N., Sant’Anna, C., Soares, S., Borba, P., Kulesza, U., Rashid, A.: On the Impact of Aspectual Decompositions on Design Stability: An Empirical Study. In: Bateni, M. (ed.) ECOOP 2007. LNCS, vol. 4609, pp. 176–200. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  18. Coelho, R., Rashid, A., von Staa, A., Noble, J., Kulesza, U., Lucena., C.: A catalogue of bug patterns for exception handling in aspect-oriented programs. In: Proc. of the 15th Conference on Pattern Languages of Programs, New York, NY, USA, pp. 1–13 (2008)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Lilis, Y., Savidis, A. (2012). Implementing Reusable Exception Handling Patterns with Compile-Time Metaprogramming. In: Avgeriou, P. (eds) Software Engineering for Resilient Systems. SERENE 2012. Lecture Notes in Computer Science, vol 7527. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-33176-3_1

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-33176-3_1

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-33175-6

  • Online ISBN: 978-3-642-33176-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics