Modularizing Design Patterns with Aspects: A Quantitative Study

  • Alessandro Garcia
  • Cláudio Sant’Anna
  • Eduardo Figueiredo
  • Uirá Kulesza
  • Carlos Lucena
  • Arndt von Staa
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3880)


Design patterns offer flexible solutions to common problems in software development. Recent studies have shown that several design patterns involve crosscutting concerns. Unfortunately, object-oriented (OO) abstractions are often not able to modularize those crosscutting concerns, which in turn compromise the system reusability and maintainability. Hence, it is important verifying whether aspect-oriented approaches support improved modularization of crosscutting concerns relative to design patterns. Ideally, quantitative studies should be performed to compare OO and aspect-oriented implementations of classical patterns with respect to fundamental software engineering attributes, such as coupling and cohesion. This paper presents a quantitative study that compares Java and AspectJ solutions for the 23 Gang-of-Four patterns. We have used stringent software attributes as the assessment criteria. We have found that most aspect-oriented solutions improve separation of pattern-related concerns, although only four aspect-oriented implementations have exhibited significant reuse. This paper also discusses the scalability of the analyzed solutions with respect to separation of concerns, and the determination of a predictive model for the modularization of design patterns with aspects.


Design Pattern Visitor Pattern Pattern Role Participant Class Decorator Pattern 
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.
    Aspect-Oriented Design Pattern Implementations (2005), (Cited May 2005)
  2. 2.
    AspectJ Team. The AspectJ Guide,
  3. 3.
    Basili, V., Briand, L., Melo, W.: A validation of object-oriented design metrics as quality indicators. IEEE Transactions on Software Engineering 22(10), 751–761 (1996)CrossRefGoogle Scholar
  4. 4.
    Basili, V., Selby, R., Hutchins, D.: Experimentation in software engineering. IEEE Transactions on Software Engineering SE-12, 733–743 (1986)CrossRefGoogle Scholar
  5. 5.
    Chidamber, S., Kemerer, C.: A metrics suite for OO design. IEEE Transactions on Software Engineering 20(6), 476–493 (1994)CrossRefGoogle Scholar
  6. 6.
    Fenton, N., Pfleeger, S.: Software metrics: A rigorous practical approach. PWS, London (1997)Google Scholar
  7. 7.
    Figueiredo, E., Garcia, A., Sant’Anna, C., Kulesza, U., Lucena, C.: Assessing aspect-oriented artifacts: Towards a tool-supported quantitative method. In: QAOOSE 2005: Proceedings of the 9th ECOOP Workshop on Quantitative Approaches in OO Software Engineering, Glasgow (2005)Google Scholar
  8. 8.
    Filho, F., Rubira, C., Garcia, A.: A quantitative study on the aspectization of exception handling. In: Proceedings of the ECOOP Workshop on Exception Handling in Object-Oriented Systems (2005)Google Scholar
  9. 9.
    Gamma, E., et al.: Design patterns: Elements of reusable object-oriented software. Addison-Wesley, Reading (1995)Google Scholar
  10. 10.
    Garcia, A.: From objects to agents: An aspect-oriented approach. Doctoral Thesis, PUC-Rio, Rio de Janeiro, Brazil (2004)Google Scholar
  11. 11.
    Garcia, A., et al.: Separation of concerns in multi-agent systems: An empirical study. In: Lucena, C., Garcia, A., Romanovsky, A., Castro, J., Alencar, P.S.C. (eds.) SELMAS 2003. LNCS, vol. 2940, pp. 49–72. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  12. 12.
    Garcia, A., Silva, V., Chavez, C., Lucena, C.: Engineering multi-agent systems with aspects and patterns. Journal of the Brazilian Computer Society 8(1), 57–72 (2002)CrossRefGoogle Scholar
  13. 13.
    Hachani, Q., Bardou, D.: On Aspect-oriented technology and object-oriented design patterns. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743. Springer, Heidelberg (2003)Google Scholar
  14. 14.
    Hachani, Q., Bardou, D.: Using aspect-oriented programming for design patterns implementation. In: OOIS: Workshop on Reuse in Object-Oriented Information Systems Design (2002)Google Scholar
  15. 15.
    Hannemann, J., Kiczales, G.: Design pattern implementation in java and aspectJ. In: OOPSLA 2002: Proceedings of the Conference on Object-Oriented Programming, Systems, Languages and Applications, pp. 161–173 (2002)Google Scholar
  16. 16.
    Henderson-Sellers, B.: Object-oriented metrics: Measures of complexity. Prentice Hall, New Jersey (1996)Google Scholar
  17. 17.
    Hirschfeld, R., et al.: Design patterns and aspects - Modular designs with seamless run-time integration. In: 3rd German GI Workshop on Aspect-Oriented Software Development (2003)Google Scholar
  18. 18.
  19. 19.
    Godil, I., Jacobsen, H.: Horizontal decomposition of prevayler. In: Proceedings of CASCON 2005, Richmond Hill, Canada (2005)Google Scholar
  20. 20.
    Java Reference Documentation,
  21. 21.
    Kersten, M., Murphy, G.: Atlas: A case study in building a web-based learning environment using aspect-oriented programming. In: OOPSLA 1999: Proceedings of the Conference on Object-Oriented Programming, Systems, Languages and Applications (1999)Google Scholar
  22. 22.
    Kiczales, G., et al.: Aspect-oriented programming. In: Aksit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 220–242. Springer, Heidelberg (1997)CrossRefGoogle Scholar
  23. 23.
    Kitchenham, B.: Evaluating software engineering methods and tools, part 1: The evaluation context and evaluation methods. ACM SIGSOFT Software Engineering Notes 21(1), 11–15 (1996)CrossRefGoogle Scholar
  24. 24.
    Lopes, C.: D: A language framework for distributed programming. PhD Thesis, Northeastern University, Boston, USA (1997)Google Scholar
  25. 25.
    Malaiya, Y., Denton, J.: Module size distribution and defect density. In: ISSRE 2000: Proceedings of the 11th International Symposium on Software Reliability Engineering (2000)Google Scholar
  26. 26.
    Mezini, M., Ostermann, K.: Conquering aspects with caesar. In: Proceedings of the 2nd International Conference on Aspect-Oriented Software Development, Boston, USA (2003)Google Scholar
  27. 27.
    Miles, R.: AspectJ cookbook. O’Reilly, UK (2004)Google Scholar
  28. 28.
    Modularizing Patterns with Aspects: A Quantitative Study,
  29. 29.
    Sant’Anna, C., et al.: On the reuse and maintenance of aspect-oriented software: An assessment framework. In: SBES 2003: Proceedings of the Brazilian Symposium on Software Engineering, Manaus, Brazil, pp. 19–34 (2003)Google Scholar
  30. 30.
    Sant’Anna, C., et al.: Design patterns as aspects: A quantitative assessment. Journal of the Brazilian Computer Society (SBES 2004; Best Paper Award), 10(2), Porto Alegre, Brazil (2004)Google Scholar
  31. 31.
    Soares, S.: An aspect-oriented implementation method. Doctoral Thesis, Federal University of Pernambuco, Recife, Brazil (2004)Google Scholar
  32. 32.
    Soares, S., Laureano, E., Borba, P.: Implementing distribution and persistence aspects with AspectJ. In: OOPSLA 2002: Proceedings of the Conference on Object-Oriented Programming, Systems, Languages and Applications, pp. 174–190 (2002)Google Scholar
  33. 33.
    Tarr, P., et al.: N degrees of separation: Multi-dimensional separation of concerns. In: ICSE 1999: Proceedings of the International Conference on Software Engineering, pp. 107–119 (1999)Google Scholar
  34. 34.
    Together Technologies,
  35. 35.
    Zhao, J.: Towards a metrics suite for aspect-oriented software. Technical-Report SE-136-25, Information Processing Society of Japan (IPSJ) (2002)Google Scholar
  36. 36.
    Zhao, J., Xu, B.: Measuring Aspect Cohesion. In: Wermelinger, M., Margaria-Steffen, T. (eds.) FASE 2004. LNCS, vol. 2984, pp. 54–68. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  37. 37.
    Zuse, H.: History of software measurement,

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Alessandro Garcia
    • 1
  • Cláudio Sant’Anna
    • 2
  • Eduardo Figueiredo
    • 2
  • Uirá Kulesza
    • 2
  • Carlos Lucena
    • 2
  • Arndt von Staa
    • 2
  1. 1.Computing Department, InfoLab 21Lancaster UniversityLancasterUnited Kingdom
  2. 2.Computer Science Department, LES, SoC+Agents GroupPUC-RioRio de JaneiroBrazil

Personalised recommendations