Extracting Error Handling to Aspects: A Cookbook

It is usually assumed that exception handling code can be better modularized by the use of aspect-oriented programming (AOP) techniques. However, recent studies argue that the ad hoc use of AOP can be detrimental to the quality of a system. When refactoring exception handling code to aspects, developers and maintainers need to follow clear and simple principles to obtain a well-structured system design. Otherwise, typical problems that stem from poorly designed/implemented error handling code will arise, e.g. resource leaking and swallowed exceptions. In this paper, we propose a classification for error handling code based on the factors that we found out have more influence on its aspectization. Moreover, we present a scenario catalog comprising combinations of these factors and analyze how these scenarios positively or negatively affect the task of aspectizing exception handling. We evaluated the proposed catalog through a case study where we used it to guide the aspectization of exception handling in two real systems.

[1]  Ramnivas Laddad Aspect Oriented Refactoring , 2008 .

[2]  Ramnivas Laddad,et al.  Aspectj in Action: Practical Aspect-Oriented Programming , 2003 .

[3]  Carlos José Pereira de Lucena,et al.  Quantifying the Effects of Aspect-Oriented Programming: A Maintenance Study , 2006, 2006 22nd IEEE International Conference on Software Maintenance.

[4]  Stefan Hanenberg,et al.  Refactoring of Aspect-Oriented Software , 2003 .

[5]  Tom Cargill Exception handling: a false sense of security , 1996 .

[6]  Cecília M. F. Rubira,et al.  Exceptions and aspects: the devil is in the details , 2006, SIGSOFT '06/FSE-14.

[7]  Cláudio Sant'Anna,et al.  On the Impact of Aspectual Decompositions on Design Stability: An Empirical Study , 2007, ECOOP.

[8]  Martin P. Robillard,et al.  Static analysis to support the evolution of exception structure in object-oriented systems , 2003, TSEM.

[9]  Flaviu Cristian A Recovery Mechanism for Modular Software , 1979, ICSE.

[10]  Arie van Deursen,et al.  Discovering faults in idiom-based exception handling , 2006, ICSE '06.

[11]  Cristina V. Lopes,et al.  Aspect-oriented programming , 1999, ECOOP Workshops.

[12]  João M. Fernandes,et al.  Towards a catalog of aspect-oriented refactorings , 2005, AOSD '05.

[13]  John B. Goodenough,et al.  Exception handling: issues and a proposed notation , 1975, CACM.

[14]  Paulo Borba,et al.  Deriving refactorings for AspectJ , 2005, AOSD '05.

[15]  David Lorge Parnas,et al.  Response to undesired events in software systems , 1976, ICSE '76.

[16]  Brian Randell,et al.  The Evolution of the Recovery Block Concept , 1994 .

[17]  Carlos José Pereira de Lucena,et al.  Modularizing design patterns with aspects: a quantitative study , 2005, AOSD '05.

[18]  Mira Mezini,et al.  Conquering aspects with Caesar , 2003, AOSD '03.

[19]  Cristina V. Lopes,et al.  A study on exception detection and handling using aspect-oriented programming , 2000, Proceedings of the 2000 International Conference on Software Engineering. ICSE 2000 the New Millennium.