skip to main content
research-article
Free Access

Essential AOP: The a calculus

Published:05 November 2012Publication History
Skip Abstract Section

Abstract

Aspect-oriented programming (AOP) has produced interesting language designs, but also ad hoc semantics that needs clarification. We contribute to this clarification with a calculus that models essential AOP, both simpler and more general than existing formalizations. In AOP, advice may intercept method invocations, and proceed executes the suspended call. Proceed is an ad hoc mechanism, only usable inside advice bodies. Many pointcut mechanisms, for example, wildcards, also lack regularity. We model proceed using first-class closures, and shift complexity from pointcuts to ordinary object-oriented code. Two well-known pointcut categories, call and execution, are commonly considered similar. We formally expose their differences, and resolve the associated soundness problem. Our calculus includes type ranges, an intuitive and concise alternative to explicit type variables that allows advice to be polymorphic over intercepted methods. We use calculus parameters to cover type safety for a wide design space of other features. Type soundness is verified in Coq.

References

  1. Aldrich, J. 2005. Open modules: Modular reasoning about advice. In Proceedings of the 19th European Conference on Object-Oriented Programming (ECOOP'05). Lecture Notes in Computer Science, vol. 3586, Springer-Verlag, 144--168. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Allan, C., Avgustinov, P., Christensen, A. S., Hendren, L., Kuzins, S., Lhoták, O., de Moor, O., Sereni, D., Sittampalam, G., and Tibble, J. 2005. Adding trace matching with free variables to AspectJ. In Proceedings of the 20th ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'05). ACM, 345--364. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Aydemir, B., Charguéraud, A., Pierce, B. C., Pollack, R., and Weirich, S. 2008. Engineering formal metatheory. In Proceedings of the 35th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL'08). ACM, 3--15. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Bertot, Y. and Castéran, P. 2004. Interactive Theorem Proving and Program Development—Coq'Art: The Calculus of Inductive Constructions. Texts in Theoretical Computer Science Series, vol. XXV, Springer. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Bodden, E. 2011. Closure joinpoints: Block joinpoints without surprises. In Proceedings of the 10th International Conference on Aspect-Oriented Software Development (AOSD'11). ACM Press, 117--128. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Brichau, J. and Haupt, Eds. 2005. Survey of aspect-oriented languages and execution models. Deliverable 12, Project IST-2-004349-NOE “AOSD-Europe”.Google ScholarGoogle Scholar
  7. Bruns, G., Jagadeesan, R., Jeffrey, A., and Riely, J. 2004. μABC: A minimal aspect calculus. In Proceedings of the International Conference on Concurrency Theory (CONCUR'04). 209--224.Google ScholarGoogle Scholar
  8. Burke, B. and Fleury, M. 2004. JBoss Aspect-Oriented Programming. http://www.jboss.org/jbossaop.Google ScholarGoogle Scholar
  9. Clifton, C. and Leavens, G. T. 2006. MiniMAO1: An imperative core language for studying aspect-oriented reasoning. Sci. Comput. Prog. 63, 3, 321--374. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. De Fraine, B. 2009. Language facilities for the deployment of reusable aspects. Ph.D. dissertation, Vrije Universiteit Brussel. http://soft.vub.ac.be/soft/_media/members/brunodefraine/phd.pdf.Google ScholarGoogle Scholar
  11. De Fraine, B., Ernst, E., and Südholt, M. 2010. Essential AOP: The A calculus. In Proceedings of the 24th European Conference on Object-Oriented Programming (ECOOP'10). T. D'Hondt, Ed., Lecture Notes in Computer Science, vol. 6183, Springer Verlag, 101--125. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. De Fraine, B., Ernst, E., and Südholt, M. 2011. Coq source for proofs of the results in this article, version 2011-10-19. http://soft.vub.ac.be/acalculus/.Google ScholarGoogle Scholar
  13. De Fraine, B., Südholt, M., and Jonckers, V. 2008. StrongAspectJ: Flexible and safe pointcut/advice bindings. In Proceedings of the 7th International Conference on Aspect-Oriented Software Development (AOSD'08). M. Mezini, Ed., ACM, 60--71. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Douence, R., Fradet, P., and Südholt, M. 2002. A framework for the detection and resolution of aspect interactions. In Proceedings of the 1st Conference on Generative Programming and Component Engineering (GPCE'02). D. Batory, C. Consel, and W. Taha, Eds. Lecture Notes in Computer Science, vol. 2487, Springer Verlag, Berlin, 173--188. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Douence, R., Fradet, P., and Südholt, M. 2004. Composition, reuse and interaction analysis of stateful aspects. In Proceedings of the 3rd International Conference on Aspect-Oriented Software Development (AOSD'04). ACM. 141--150. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Douence, R., Motelet, O., and Südholt, M. 2001. A formal definition of crosscuts. In Proceedings of the 3rd International Conference on Metalevel Architectures and Separation of Crosscutting Concerns. Lecture Notes in Computer Science, vol. 2192, Springer Verlag, 170--186. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Ernst, E. and Lorenz, D. H. 2003. Aspects and polymorphism in AspectJ. In Proceedings of the 2nd International Conference on Aspect-Oriented Software Development (AOSD'03). ACM, 150--157. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Gybels, K. and Brichau, J. 2003. Arranging language features for pattern-based crosscuts. In Proceedings of the 2nd International Conference on Aspect-Oriented Software Development (AOSD'03). ACM, 60--69. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Igarashi, A., Pierce, B., and Wadler, P. 2001. Featherweight Java: A minimal core calculus for Java and GJ. Trans. Prog. Lang. Syst. 23, 3, 396--450. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Jagadeesan, R., Jeffrey, A., and Riely, J. 2006. Typed parametric polymorphism for aspects. Sci. Comput. Prog. 63, 3, 267--296. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Johnson, R. and Hoeller, J. 2004. Spring Java/J2EE application framework. http://www.springsource.org.Google ScholarGoogle Scholar
  22. Kiczales, G., Hilsdale, E., Hugunin, J., Kersten, M., Palm, J., and Griswold, W. G. 2001. An overview of AspectJ. In Proceedings of the 15th European Conference on Object-Oriented Programming (ECOOP'01). J. L. Knudsen, Ed. Lecture Notes in Computer Science, vol. 2072, Springer Verlag, Berlin, 327--353. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Kiczales, G., Lamping, J., Mendhekar, A., Maeda, C., Lopes, C., Loingtier, J.-M., and Irwin, J. 1997. Aspect-oriented programming. In Proceedings of the 11th European Conference on Object-Oriented Programming (ECOOP'97), M. Akşit and S. Matsuoka, Eds., Lecture Notes in Computer Science, vol. 1241. Springer Verlag, 220--242.Google ScholarGoogle Scholar
  24. Lämmel, R. 2002. A semantical approach to method-call interception. In Proceedings of the 1st International Conference on Aspect-Oriented Software Development (AOSD'02). G. Kiczales, Ed., ACM, 41--55. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Ligatti, J., Walker, D., and Zdancewic, S. 2006. A type-theoretic interpretation of pointcuts and advice. Sci. Comput. Prog. 63, 3, 240--266. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Lorenz, D. H., Lieberherr, K., and Ovlinger, J. 2003. Aspectual collaborations: Combining modules and aspects. Comput. J. 46, 5, 542--565.Google ScholarGoogle ScholarCross RefCross Ref
  27. Mezini, M. and Lieberherr, K. 1998. Adaptive plug-and-play components for evolutionary software development. In Proceedings of the 13th Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'98). ACM, New York, 97--116. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Odersky, M., Sulzmann, M., and Wehr, M. 1999. Type inference with constrained types. Theory Pract. Obj. Syst. 5, 1, 35--55. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Ostermann, K., Mezini, M., and Bockisch, C. 2005. Expressive pointcuts for increased modularity. In Proceedings of the 19th European Conference on Object-Oriented Programming (ECOOP'05). Lecture Notes in Computer Science, vol. 3586, 214--240. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Rinard, M., Salcianu, A., and Bugrara, S. 2004. A classification system and analysis for aspect-oriented programs. In Proceedings of the 12th ACM SIGSOFT 12th International Symposium on Foundations of Software Engineering (SIGSOFT '04/FSE-12). ACM, New York, 147--158. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Sakurai, K., Masuhara, H., Ubayashi, N., Matsuura, S., and Komiya, S. 2004. Association aspects. In Proceedings of the 3rd International Conference on Aspect-Oriented Software Development (AOSD'04). ACM, 16--25. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Suvée, D., Vanderperren, W., and Jonckers, V. 2003. JAsCo: An aspect-oriented approach tailored for component based software development. In Proceedings of the 2nd International Conference on Aspect-Oriented Software Development (AOSD'03). ACM, 21--29. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Tatsuzawa, H., Masuhara, H., and Yonezawa, A. 2005. Aspectual Caml: An aspect-oriented functional language. In Proceedings of the 10th International Conference on Functional Programming (ICFP'05), B. Pierce, Ed., ACM, 320--330. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Torgersen, M., Hansen, C. P., Ernst, E., von der Ahé, P., Bracha, G., and Gafter, N. M. 2004. Adding wildcards to the Java programming language. In Proceedings of the ACM Symposium on Applied Computing (SAC). H. Haddad, A. Omicini, R. L. Wainwright, and L. M. Liebrock, Eds., ACM, 1289--1296. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Walker, R. J. and Viggers, K. 2004. Implementing protocols via declarative event patterns. In Proceedings of the ACM SIGSOFT International Symposium on Foundations of Software Engineering (FSE-12). ACM, 159--169. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Wallach, D. S. and Felten, E. W. 1998. Understanding java stack inspection. In Proceedings of the IEEE Symposium on Security and Privacy. 52--63.Google ScholarGoogle Scholar
  37. Wand, M., Kiczales, G., and Dutchyn, C. 2004. A semantics for advice and dynamic join points in aspect-oriented programming. Trans. Prog. Lang. Syst. 26, 5, 890--910. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Essential AOP: The a calculus

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in

          Full Access

          • Published in

            cover image ACM Transactions on Programming Languages and Systems
            ACM Transactions on Programming Languages and Systems  Volume 34, Issue 3
            October 2012
            183 pages
            ISSN:0164-0925
            EISSN:1558-4593
            DOI:10.1145/2362389
            Issue’s Table of Contents

            Copyright © 2012 ACM

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 5 November 2012
            • Accepted: 1 March 2012
            • Revised: 1 October 2011
            • Received: 1 April 2011
            Published in toplas Volume 34, Issue 3

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • research-article
            • Research
            • Refereed
          • Article Metrics

            • Downloads (Last 12 months)14
            • Downloads (Last 6 weeks)0

            Other Metrics

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader
          About Cookies On This Site

          We use cookies to ensure that we give you the best experience on our website.

          Learn more

          Got it!