Skip to main content

On the benefits of quantification in AspectJ systems

Abstract

In this paper, we argue that the most favorable uses of aspects happen when their code relies extensively on quantified statements, i.e., statements that may affect many parts of a system. When this happens, aspects better contribute to separation of concerns, since the otherwise duplicated and tangled code related to the implementation of a crosscutting concern is confined in a single block of code. We provide in the paper both qualitative and quantitative arguments in favor of quantification. We also propose two new metrics to capture in a simple way the amount of quantification employed in the aspects of a given system. Finally, we describe an Eclipse plugin, called ConcernMetrics that estimates the proposed metrics directly from the object-oriented code of an existing system, i.e., before crosscutting concerns are extracted to aspects. Our main motivation is to help developers and maintainers to decide in a cost-effective way if it is worthwhile to use aspects in their systems.

References

  1. 1.

    Anbalagan P, Xie T (2007) Automated inference of pointcuts in aspect-oriented refactoring. In: 29th international conference on software engineering (ICSE), May 2007

  2. 2.

    Apel S (2010) How AspectJ is used: an analysis of eleven AspectJ programs. J Object Technol 9(1):117–142

    Article  Google Scholar 

  3. 3.

    Apel S, Batory D (2006) When to use features and aspects: a case study. In: 5th international conference on generative programming and component engineering (GPCE), pp 59–68

  4. 4.

    Apel S, Leich T, Rosenmüller M, Saake G (2005) FeatureC++: on the symbiosis of feature-oriented and aspect-oriented programming. In: 4th international conference on generative programming and component engineering (GPCE). Lecture notes in computer science, vol 3676. Springer, Berlin, pp 125–140

    Google Scholar 

  5. 5.

    Batory D (2004) Feature-oriented programming and the AHEAD tool suite. In: 26th international conference on software engineering (ICSE), pp 702–703

  6. 6.

    Binkley D, Ceccato M, Harman M, Ricca F, Tonella P (2005) Automated refactoring of object oriented code into aspects. In: 21st IEEE international conference on software maintenance (ICSM), pp 27–36

  7. 7.

    Binkley D, Ceccato M, Harman M, Ricca F, Tonella P (2006) Tool-supported refactoring of existing object-oriented code into aspects. IEEE Trans Softw Eng 32(9):698–717

    Article  Google Scholar 

  8. 8.

    Ceccato M, Tonella P (2004) Measuring the effects of software aspectization. In: 1st workshop on aspect reverse engineering (WARE 2004)

  9. 9.

    Ceccato M, Marin M, Mens K, Moonen L, Tonella P, Tourwé T (2005) A qualitative comparison of three aspect mining techniques. In: 13th international workshop on program comprehension (IWPC), pp 13–22

  10. 10.

    Chidamber SR, Kemerer CF (1994) A metrics suite for object oriented design. IEEE Trans Softw Eng 20(6):476–493

    Article  Google Scholar 

  11. 11.

    Clements P, Northrop LM (2002) Software product lines: practices and patterns. Addison-Wesley, Reading

    Google Scholar 

  12. 12.

    Cole L, Borba P (2005) Deriving refactorings for AspectJ. In: 4th international conference on aspect-oriented software development (AOSD), pp 123–134

  13. 13.

    Colyer A, Clement A (2004) Large-scale AOSD for middleware. In: 3rd international conference on aspect-oriented software development. ACM, New York, pp 56–65

    Google Scholar 

  14. 14.

    Eaddy M, Zimmermann T, Sherwood KD, Garg V, Murphy Gail C, Nagappan N, Aho AV (2008) Do crosscutting concerns cause defects? IEEE Trans Softw Eng 34(4):497–515

    Article  Google Scholar 

  15. 15.

    Figueiredo E, Cacho N, Sant’Anna C, Monteiro M, Kulesza U, Garcia A, Soares S, Ferrari FC, Khan SS, Filho FC, Dantas F (2008) Evolving software product lines with aspects: an empirical study on design stability. In: 30th international conference on software engineering (ICSE), pp 261–270

  16. 16.

    Figueiredo E, Whittle J, Garcia AF (2009) ConcernMorph: metrics-based detection of crosscutting patterns. In: 7th international symposium on foundations of software engineering (FSE), pp 299–300

  17. 17.

    Filho FC, Cacho N, Figueiredo E, Maranhao R, Garcia A, Rubira C (2006) Exceptions and aspects: the devil is in the details. In: 14th international symposium on foundations of software engineering (FSE), pp 152–162

  18. 18.

    Filman RE, Friedman DP (2000) Aspect-oriented programming is quantification and obliviousness. In: OOSPLA workshop on advanced separation of concerns, October 2000

  19. 19.

    Fowler M, Beck K, Brant J, Opdyke W, Roberts D (1999) Refactoring: improving the design of existing code. Addison-Wesley, Reading

    Google Scholar 

  20. 20.

    Garcia A, Sant’Anna C, Figueiredo E, Kulesza U, de Lucena CJP, von Staa A (2005) Modularizing design patterns with aspects: a quantitative study. In: 4th international conference on aspect-oriented software development (AOSD), pp 3–14

  21. 21.

    Garcia A, Greenwood P, Heineman G, Walker R, Cai Y, Yang HY, Baniassad E, Lopes CV, Schwanninger C, Zhao J (2007) Assessment of contemporary modularization techniques (ACoM) 2007: workshop report. SIGSOFT Softw Eng Notes 32(5):31–37

    Article  Google Scholar 

  22. 22.

    Greenwood P, Bartolomei TT, Figueiredo E, Dósea M, Garcia AF, Cacho N, Sant’Anna C, Soares S, Borba P, Kulesza U, Rashid A (2007) On the impact of aspectual decompositions on design stability: an empirical study. In: 21st European conference on object-oriented programming (ECOOP), pp 176–200

  23. 23.

    Hilsdale E, Hugunin J (2004) Advice weaving in AspectJ. In: 3rd international conference on aspect-oriented software development (AOSD), pp 26–35

  24. 24.

    Kastner C, Apel S, Batory D (2007) A case study implementing features using AspectJ. In: 11th international software product line conference (SPLC), pp 223–232

  25. 25.

    Kellens A, Mens K, Tonella P (2007) A survey of automated code-level aspect mining techniques. Trans Aspect-Oriented Softw Dev 4:145–164

    Google Scholar 

  26. 26.

    Kiczales G, Lamping J, Mendhekar A, Maeda C, Lopes C, Loingtier J-M, Irwin J (1997) Aspect-oriented programming. In: 11th European conference on object-oriented programming (ECOOP). LNCS, vol 1241. Springer, Berlin, pp 220–242

    Google Scholar 

  27. 27.

    Kiczales G, Hilsdale E, Hugunin J, Kersten M, Palm J, Griswold WG (2001) An overview of AspectJ. In: 15th European conference on object-oriented programming (ECOOP). LNCS, vol 2072. Springer, Berlin, pp 327–355

    Google Scholar 

  28. 28.

    Koppen C, Störzer M (2004) PCDiff: attacking the fragile pointcut problem. In: European interactive workshop on aspects in software (EIWAS), September 2004

  29. 29.

    Kulesza U, Sant’Anna C, Garcia A, Coelho R, von Staa A, Lucena C (2006) Quantifying the effects of aspect-oriented programming: a maintenance study. In: 22nd IEEE international conference on software maintenance, pp 223–233

  30. 30.

    Laddad R (2003) Aspect-oriented refactoring. TheServerSide.com

  31. 31.

    Liu J, Batory D, Lengauer C (2006) Feature oriented refactoring of legacy applications. In: 28th international conference on software engineering (ICSE), pp 112–121

  32. 32.

    Lopez-Herrejon R, Apel S (2007) Measuring and characterizing crosscutting in aspect-based programs: basic metrics and case studies. In: 10th international conference on fundamental approaches to software engineering (FASE), March 2007

  33. 33.

    Lopez-Herrejon R, Batory D, Cook WR (2005) Evaluating support for features in advanced modularization technologies. In: 19th European conference on object-oriented programming (ECOOP). LNCS, vol 3586. Springer, Berlin, pp 169–194

    Google Scholar 

  34. 34.

    Marin M, van Deursen A, Moonen L (2007) Identifying crosscutting concerns using fan-in analysis. ACM Trans Softw Eng Methodol 17(1)

  35. 35.

    Marin M, van Deursen A, Moonen L, van der Rijst R (2009) An integrated crosscutting concern migration strategy and its semi-automated application to JHotDraw. Autom Softw Eng 16(2):323–356

    Article  Google Scholar 

  36. 36.

    Monteiro MP, Fernandes JM (2006) Towards a catalogue of refactorings and code smells for AspectJ. Trans Aspect-Oriented Softw Dev 3880:214–258

    Article  Google Scholar 

  37. 37.

    Nassau M, Valente MT (2009) Object-oriented transformations for extracting aspects. Inf Softw Technol 51(1):138–149

    Article  Google Scholar 

  38. 38.

    Nassau M, Oliveira S, Valente MT (2009) Guidelines for enabling the extraction of aspects from existing object-oriented code. J Object Technol 8(3):101–119

    Google Scholar 

  39. 39.

    Parnas DL (1972) On the criteria to be used in decomposing systems into modules. Commun ACM 15(12):1053–1058

    Article  Google Scholar 

  40. 40.

    Robillard MP, Weigand-Warr F (2005) ConcernMapper: simple view-based separation of scattered concerns. In: OOPSLA eclipse technology exchange workshop (ETX), pp 65–69

  41. 41.

    Sant’Anna C, Garcia A, Chavez C, Lucena C, von Staa A (2003) On the reuse and maintenance of aspect-oriented software: an assessment framework. In: 17th Brazilian symposium on software engineering (SBES), pp 19–34

  42. 42.

    Soares S, Laureano E, Borba P (2002) Implementing distribution and persistence aspects with AspectJ. In: Proceedings of the 17th ACM conference on object-oriented programming, systems, languages, and applications, OOPSLA’02, Seattle, WA, USA, November 2002. ACM, New York, pp 174–190

    Google Scholar 

  43. 43.

    Steimann F (2006) The paradoxical success of aspect-oriented programming. In: 21st conference on object-oriented programming systems, languages, and applications (OOPSLA), pp 481–497

  44. 44.

    Wand M (2003) Understanding aspects: extended abstract. In: 8th international conference on functional programming (ICFP). ACM, New York, pp 299–300

    Google Scholar 

  45. 45.

    Zhao J, Xu B (2004) Measuring aspect cohesion. In: 7th fundamental approaches to software engineering (FASE). Lecture notes in computer science, vol 2984. Springer, Berlin, pp 54–68

    Google Scholar 

Download references

Author information

Affiliations

Authors

Corresponding author

Correspondence to Marco Tulio Valente.

Rights and permissions

Reprints and Permissions

About this article

Cite this article

Valente, M.T., Couto, C., Faria, J. et al. On the benefits of quantification in AspectJ systems. J Braz Comput Soc 16, 133–146 (2010). https://doi.org/10.1007/s13173-010-0008-0

Download citation

Keywords

  • Aspect-oriented programming
  • AspectJ
  • Quantification
  • Separation of Concerns
  • Metrics
  • Refactoring