Is Exception Handling a Reusable Aspect? - Almeida, Adauto; Barreiros, Emanoel; Saraiva, Juliana; Castor, Fernando; Soares, Sérgio (Anais do Simpósio Brasileiro de Componentes, Arquiteturas e Reutilização de Software (SBCARS); 2014: Anais do VIII Simpósio Brasileiro de Componentes, Arquiteturas e Reutilização de Software, 2014)
A number of studies have evaluated the impact of modularizing the exception handling concern using aspect-oriented programming (AOP). Even though some of these studies have claimed that reuse through AOP is possible and advantageous in some cases, they have not focused specifically on reuse, often using the overall number of lines of code as a proxy for it. This has produced often contradictory results that are difficult to understand and extrapolate. In this paper we describe a study whose goal is to answer the question in the title of the paper. We have extracted exception handlers from 10 distinct applications to AspectJ aspects and, whenever possible, reused the handlers that were duplicated throughout each application. We have also collected a number of metrics from these systems and analyzed whether there is a relationship between the exception handling strategies that an application employs and the extent to which handlers implementing them are reusable. We discuss some scenarios and complicating factors related to reuse and present solutions that we have found to circumvent these complications. We also analyze limitations of current AspectJ constructs.