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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Goodenough, J.B.: Exception handling: Issues and a proposed notation. Communications of the ACM 18(12), 683–696 (1975)
Doshi, G.: Best practices for exception handling (2003), http://www.onjava.com/pub/a/onjava/2003/11/19/exceptions.html (accessed May 11, 2012)
McCune T.: Exception-handling antipatterns (2006), http://today.java.net/pub/a/today/2006/04/06/exceptionhandling-antipatterns.html (accessed May 11, 2012)
Savidis, A.: Delta Language (2010), http://www.ics.forth.gr/hci/files/plang/Delta/Delta.html (accessed May 11, 2012)
Bertrand, M.: Design by Contract. In: Mandrioli, D., Meyer, B. (eds.) Advances in Object-Oriented Software Engineering, pp. 1–50. Prentice Hall (1991)
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)
Wirfs-Brock, R.: What it Really Takes to Handle Exceptions in Use Cases. In: Use 2002 Conference Proceedings, pp. 341–370 (2002)
Newton, K.: The Exception Handling Application Block. From. The Definitive Guide to the Microsoft Enterprise Library, pp. 221–257. Apress (2007)
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)
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)
Laddad, R.: AspectJ in Action. Manning 512 (2003)
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)
Laddad R. Aspect-Oriented refactoring, parts 1 and 2. The Server Side (2003), www.theserverside.com (accessed May 11, 2012)
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)
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)
Castor, F., Garcia, A., Rubira, C.: Extracting Error Handling to Aspects: A Cookbook. In: Proceedings of the 23rd ICSM, Paris, France (2007)
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)
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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)