skip to main content
10.1145/1960510.1960514acmotherconferencesArticle/Chapter ViewAbstractPublication PagesmodularityConference Proceedingsconference-collections
research-article

Aspect oriented programming: a language for 2-categories

Published:21 March 2011Publication History

ABSTRACT

Aspect-Oriented Programming (AOP) started ten years ago with the remark that modularization of so-called crosscutting functionalities is a fundamental problem for the engineering of large-scale applications. Originating at Xerox PARC, this observation has sparked the development of a new style of programming featured that is gradually gaining traction, as it is the case for the related concept of code injection, in the guise of frameworks such as Swing and Google Guice. However, AOP lacks theoretical foundations to clarify this new idea. This paper proposes to put a bridge between AOP and the notion of 2-category to enhance the conceptual understanding of AOP. Starting from the connection between the !-calculus and the theory of categories, we propose to see an aspect as a morphism between morphisms'that is as a program that transforms the execution of a program. To make this connection precise, we develop an advised !-calculus that provides an internal language for 2-categories and show how it can be used as a base for the definition of the weaving mechanism of a realistic functional AOP language, called MinAML

References

  1. D. Dantas and D. Walker. Harmless advice. In 8th, volume 41, page 396, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. B. Hilken. Towards a proof theory of rewriting: the simply typed 2!-calculus. Theoretical Computer Science, 170(1-2):407--444, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. M. Hyland, G. Plotkin, and J. Power. Combining effects: sum and tensor. Theoretical Computer Science, 357(1):70--99, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. R. Jagadeesan, A. Jeffrey, and J. Riely. A calculus of untyped aspect-oriented programs. In Proceedings of ECOOP, pages 54--73. Springer-Verlag, 2003.Google ScholarGoogle ScholarCross RefCross Ref
  5. G. Kiczales, J. Lamping, A. Mendhekar, C. Maeda, C. Lopes, J. Loingtier, and J. Irwin. Aspect-Oriented Programming. In Proceedings of ECOOP, volume 1241. Springer-Verlag, 1997.Google ScholarGoogle Scholar
  6. S. Kovalyov. Modeling Aspects by Category Theory. FOAL 2010 Proceedings, page 63, 2010.Google ScholarGoogle Scholar
  7. J. Lambek. Cartesian closed categories and typed lambda-calculi. In 13th Spring School on Combinators and Functional Programming Languages, page 175. Springer-Verlag, 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. J. Lambek and P. Scott. Introduction to higher order categorical logic. Cambridge University Press, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. R. Lopez-Herrejon, D. Batory, and C. Lengauer. A disciplined approach to aspect composition. In Proceedings of the 2006 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation, page 77. ACM, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. E. Moggi. Notions of computation and monads. Information and Computation, 93:55--92, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. P. Scott. Some aspects of categories in computer science. Handbook of algebra, 2:3--77, 2000.Google ScholarGoogle ScholarCross RefCross Ref
  12. R. Seely. Modelling computations: a 2-categorical framework. In 2nd, pages 65--71, 1987.Google ScholarGoogle Scholar
  13. N. Tabareau. Aspect oriented programming: a language for 2-categories (long version). Technical Report RR-7527, INRIA, 2011. http://hal.inria.fr/inria-00470400.Google ScholarGoogle Scholar
  14. É. Tanter. Execution levels for aspect-oriented programming. In Proceedings of the 9th conference on AOSD, pages 37--48, Rennes and Saint Malo, France, Mar. 2010. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. D. Walker, S. Zdancewic, and J. Ligatti. A theory of aspects. In 8th, volume 38, pages 127--139, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. M. Wand, G. Kiczales, and C. Dutchyn. A semantics for advice and dynamic join points in aspect-oriented programming. ACM Transactions on Programming Languages and Systems, 26(5):890--910, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Aspect oriented programming: a language for 2-categories

      Recommendations

      Reviews

      Jacques Carette

      There is a continuing struggle to deal with Dijkstra's "separation of concerns" in an appropriately modular manner. It is an interesting problem in that it is both completely solved (at the design level) and rather open (at the implementation level). Aspect-oriented programming (AOP) has been touted as a solution for this problem. But, in practice, AOP has turned out to provide solutions as well as new problems. If one uses a traditional notion of modularization of modules as based on information hiding, then AOP has deservedly been called anti-modular. Furthermore, while it has at least one quite mature implementation in AspectJ, there are no good semantic formalizations available that would give AOP a satisfying theoretical foundation. This work firmly attempts to deal with that last problem. The theory brought to bear is not light: 2-categories. More precisely, there is an attempt to mimic the work done on categorical semantics of the lambda calculus. There, it was found that the internal language of a Cartesian closed category was (essentially) the simply typed lambda calculus. It is natural to explore the same question for 2-categories. The novelty claimed here is that this corresponds to some sort of aspect language. And this is where things start to fall apart: in this rather short (five-page) paper, crucial ideas, and certainly proofs, are omitted. Since there is a much longer version in existence, and the workshop also accepted long papers, one wonders why only a short version was published. Furthermore, while it is convincing that the internal language of a 2-category adds certain features for program transformation, it is quite a large stretch to claim that this corresponds to "aspects." Lastly, the gulf between practice (aspects on top of object-oriented languages) and this theory (program transformations on top of the lambda calculus) is enormous, and it is not clear how it will be bridged. I cannot decide whether this is an early paper on the semantics of AOP showing interesting insights, or a vain attempt to use fancy mathematics to explain AOP. There are insights here, but they seem to be about program transformation, not about AOP. Online Computing Reviews Service

      Access critical reviews of Computing literature here

      Become a reviewer for Computing Reviews.

      Comments

      Login options

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

      Sign in
      • Published in

        cover image ACM Other conferences
        FOAL '11: Proceedings of the 10th international workshop on Foundations of aspect-oriented languages
        March 2011
        40 pages
        ISBN:9781450306447
        DOI:10.1145/1960510

        Copyright © 2011 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 21 March 2011

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Author Tags

        Qualifiers

        • research-article

        Acceptance Rates

        Overall Acceptance Rate5of6submissions,83%

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader