Towards a Catalogue of Refactorings and Code Smells for AspectJ

  • Miguel P. Monteiro
  • João M. Fernandes
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3880)


In this paper, we contribute to the characterisation of a programming style specific to aspect-oriented programming. For this purpose, we present a collection of refactorings for aspect-oriented source code, comprising refactorings to enable extraction to aspects of crosscutting concerns from object-oriented legacy code, the subsequent tidying up of the extracted aspects and factoring out of common code from similar aspects to superaspects. The second group of refactorings is documented in detail. In addition, we propose some new aspect-oriented code smells, including one smell that is specific to aspect modules. We also propose a reinterpretation of some of the traditional object-oriented code smells in the light of aspect-orientation, to detect the presence of crosscutting concerns.


Target Object Code Base Aspect Method Code Smell Public Void 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Beck, K.: Extreme programming explained: Embrace change. Addison-Wesley, Reading (2000)Google Scholar
  2. 2.
    Bracha, G., Cook, W.: Mixin-based inheritance. In: ECOOP/OOPSLA1990: Proceedings of Conference on Object-Oriented Programming: Systems, Languages, and Applications and European Conference on Object-Oriented Programming, pp. 303–311. ACM Press, New York (1990)CrossRefGoogle Scholar
  3. 3.
    Cole, L., Borba, P.: Deriving refactorings for AspectJ. In: AOSD 2005: Proceedings of the 4th International Conference on Aspect-Oriented Software Development, pp. 123–134. ACM Press, New York (2005)Google Scholar
  4. 4.
    Colyer, A., Clement, A.: Large-scale AOSD for middleware. In: Proceedings of the 3rd International Conference on Aspect-Oriented Software Development (AOSD 2004), pp. 56–65. ACM Press, New York (2004)CrossRefGoogle Scholar
  5. 5.
    Cooper, J.: Java design patterns: A tutorial. Addison-Wesley, Reading (2000), Also available at: Google Scholar
  6. 6.
    qDeursen, A., Marin, M., Moonen, L.: Aspect mining and Refactoring. In: REFACE 2003 Workshop on REFactoring: Achievements, Challenges, Effects(November 2003), Waterloo, Canada (2003)Google Scholar
  7. 7.
    Dijkstra, E.: Go-to statement considered harmful. Communications of the ACM 11(3), 147–148 (1968)CrossRefGoogle Scholar
  8. 8.
    Eckel, B.: Thinking in Patterns, revision 0.9. book in progress (2003), Available at:
  9. 9.
    Filman, R.E., Friedman, D.P.: Aspect-oriented programming is quantification and obliviousness. In: Workshop on Advanced Separation of Concerns at OOPSLA 2000, Minneapolis (2000)Google Scholar
  10. 10.
    Fowler, M., et al.: Refactoring – Improving the Design of Existing Code. Addison-Wesley, Reading (2000)zbMATHGoogle Scholar
  11. 11.
    Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design patterns. In: Elements of Reusable Object-Oriented Software, Addison-Wesley, Reading (1995)Google Scholar
  12. 12.
    Garcia, A., Sant’Anna, C., Figueiredo, E., Kulesza, U., Lucena, C., Staa, A.: Modularizing design patterns with aspects: A quantitative study. In: AOSD 2005: Proceedings of the 4th International Conference on Aspect-Oriented Software Development, pp. 3–14. ACM Press, New York (2005)Google Scholar
  13. 13.
    Griswold, W.G.: Program restructuring as an aid to software maintenance. PhD Thesis, University of Washington, USA (1991)Google Scholar
  14. 14.
    Griswold W.G., Sullivan K.J., Song Y., Cai Y., Shonle M., Tewari N., Rajan H.: Modular software design with crosscutting interfaces. IEEE Software, Special Issue on Aspect-Oriented Programming (2006) Google Scholar
  15. 15.
    Hanenberg, S., Oberschulte, C., Unland, R.: Refactoring of Aspect-Oriented Software, Net.Objectdays (2003), Erfurt, Germany (2003)Google Scholar
  16. 16.
    Hannemann, J., Kiczales, G.: Design pattern implementation in Java and AspectJ. In: OOPSLA 2002: Proceedings of the 17th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, pp. 161–173. ACM, New York (2002)CrossRefGoogle Scholar
  17. 17.
    Hannemann, J., Murphy, G., Kiczales, G.: Role-based refactoring of crosscutting concerns. In: AOSD 2005: Proceedings of the 4th International Conference on Aspect-Oriented Software Development, pp. 135–146. ACM, New York (2005)Google Scholar
  18. 18.
    Iwamoto, M., Zhao, J.: Refactoring aspect-oriented programs. In: 4th AOSD Modelling With UML Workshop at UML 2003, San Francisco, USA (2003)Google Scholar
  19. 19.
    Jacobson, I., Christerson, M., Jonsson, P., Övergaard, G.: Object-oriented software engineering: A use case driven approach. Addison-Wesley, Reading (1992)zbMATHGoogle Scholar
  20. 20.
    Kang, K.C., Cohen, S.G., Hess, J.A., Novak, W.E., Peterson, A.: Feature-oriented Domain Analysis Feasibility Study, SEI, Technical Report CMU/SEI-90-TR-21 (1990)Google Scholar
  21. 21.
    Kerievsky, J.: Refactoring to patterns. Addison-Wesley, Reading (2004)CrossRefGoogle Scholar
  22. 22.
    Kiczales, G., Hilsdale, E., Hugunin, J., Kersten, M., Palm, J., Griswold, W.G.: An overview of AspectJ. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 327–353. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  23. 23.
    Kiczales, G., Lamping, J., Mendhekar, A., Maeda, C., Lopes, C., Loingtier, J., Irwin, J.: Aspect-Oriented Programming. In: Aksit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 220–242. Springer, Heidelberg (1997)CrossRefGoogle Scholar
  24. 24.
    Koppen, C., Störzer, M.: PCDiff: Attacking the fragile pointcut problem. In: EIWAS 2004: Interactive Workshop on Aspects in Software, Berlin, Germany (2004)Google Scholar
  25. 25.
    Laddad, R.: Aspect-oriented refactoring, parts 1 and 2. The Server Side (2003),
  26. 26.
    Laddad, R.: AspectJ in Action – Practical Aspect-Oriented Programming, Manning, Greenwich, CT, USA (2003)Google Scholar
  27. 27.
    Monteiro, M.P.: Refactorings to Evolve Object-Oriented Systems with Aspect-Oriented Concepts. Ph.D. Thesis, Universidade do Minho, Portugal (2005)Google Scholar
  28. 28.
    Monteiro, M.P., Fernandes, J.M.: Object-to-aspect refactorings for feature extraction. In: AOSD 2004: Industry Track Paper at the 3rd International Conference on Aspect-Oriented Software Development,, Lancaster, UK (2004)Google Scholar
  29. 29.
    Monteiro, M.P., Fernandes, J.M.: Refactoring a java code base to AspectJ – An illustrative example. In: ICSM 2005: Proceedings of the IEEE International Conference on Software Maintenance 2005, Budapest, Hungary (2005)Google Scholar
  30. 30.
    Monteiro, M.P., Fernandes, J.M.: Towards a catalogue of aspect-oriented refactorings. In: AOSD 2005: Proceedings of the 4th International Conference on Aspect-Oriented Software Development,, pp. 111–122. ACM Press, New York (2005)Google Scholar
  31. 31.
    Opdyke, W.F.: Refactoring object-oriented frameworks. Ph.D. Thesis, University of Illinois at Urbana-Champaign, USA (1992)Google Scholar
  32. 32.
    Orleans, D.: Separating behavioral concerns with predicate dispatch, or, if statement considered harmful. In: Workshop on Advanced Separation of Concerns in Object-Oriented Systems at OOPSLA 2001, Tampa Bay, USA (2001)Google Scholar
  33. 33.
    Sabbah, D.: Aspects – From promise to reality. In: AOSD 2004: Proceedings of the 3rd International Conference on Aspect-Oriented Software Development, pp. 1–2. ACM Press, New York (2004)Google Scholar
  34. 34.
    Sullivan, K.J., Griswold, W.G., Song, Y., Cai, Y., Shonle, M., Tewari, N., Rajan, H.: Information hiding interfaces for aspect-oriented design. In: ESEC/FSE 2005 Proceedings of the Joint 10th European Software Engineering Conference and 13th ACM SIGSOFT Symposium on the Foundations of Software Engineering, pp. 166–175. ACM Press, New York (2005)Google Scholar
  35. 35.
    Tonella, P., Ceccato, M.: Migrating interface implementation to aspects. In: ICSM 2004 Proceedings of 20th IEEE International Conference on Software Maintenance, Chicago, USA, pp. 220–229. IEEE Computer Society, Los Alamitos (2004)CrossRefGoogle Scholar
  36. 36.
    Tourwé, T., Brichau, J., Gybels, K.: On the existence of the AOSD-Evolution paradox. In: Workshop on Software-Engineering Properties of Languages for Aspect Technologies at AOSD 2003, Boston, USA (2003)Google Scholar
  37. 37.
    Wake, W.: Refactoring workbook. Addison-Wesley, Reading (2004)Google Scholar
  38. 38.
    Zhang, C., Jacobsen, H.-A.: Quantifying aspects in middleware platforms. In: AOSD 2003: Proceedings of the 2nd International Conference on Aspect-Oriented Software Development, pp. 130–139. ACM, Boston (2003)Google Scholar
  39. 39.
    Zhao, J.: Towards a Metrics Suite for Aspect-Oriented Software. Technical-Report, SE-2002-136-25, Information Processing Society of Japan (IPSJ) (2002)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Miguel P. Monteiro
    • 1
  • João M. Fernandes
    • 2
  1. 1.Instituto Politécnico de Castelo Branco, Avenida do EmpresárioEscola Superior de TecnologiaCastelo BrancoPortugal
  2. 2.Departamento de InformáticaUniversidade do MinhoBragaPortugal

Personalised recommendations