skip to main content
10.1145/508386.508396acmotherconferencesArticle/Chapter ViewAbstractPublication PagesmodularityConference Proceedingsconference-collections
Article

Runtime aspect weaving through metaprogramming

Published:22 April 2002Publication History

ABSTRACT

We describe an extension to the Java language, Handi-Wrap, that supports weaving aspects into code at runtime. Aspects in Handi-Wrap take the form of method wrappers, which allow aspect code to be inserted around method bodies like advice in AspectJ. Handi-Wrap offers several advantages over static aspect languages such as AspectJ. First, aspects can be woven into binary libraries. Second, a wrapper in Handi-Wrap is a first-class Java value, which allows users to exploit Java mechanisms to define and weave wrappers. For example, wrappers can be passed explicit constructor arguments, and wrapper objects can be composed. Finally, methods in all Java classes, including anonymous classes, can be wrapped. A prototype of Handi-Wrap is implemented in a compile-time metaprogramming system for Java, called Maya; we briefly describe how Maya's features support Handi-Wrap.

References

  1. J. Bachrach and K. Playford. The Java syntactic extender (JSE). In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications, Oct. 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. J. Baker. Macros that play: Migrating from Java to Maya. Master's thesis, University of Utah, December 2001.]]Google ScholarGoogle Scholar
  3. J. Baker and W. Hsieh. Maya: Multiple-dispatch syntax extension in Java. To appear in Proceedings of the Conference on Programming Language Design and Implementation, Jun.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. D. Batory, B. Lofaso, and Y. Smaragdakis. JTS: Tools for implementing domain-specific languages. In 5th International Conference on Software Reuse, 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. K. Böllert. On weaving aspects. In ECOOP Workshop on Aspect-Oriented Programming, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. P. Bothner. Kawa---compiling dynamic languages to the Java VM. In Proceedings of the USENIX Technical Conference, FREENIX Track, New Orleans, LA, Jun. 1998. USENIX Association.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. G. Bracha, M. Odersky, D. Stoutamire, and P. Wadler. Making the future safe for the past: Adding genericity to the Java programming language. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications, Vancouver, October 1998. ACM.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. A. Bryant, A. Catton, K. D. Volder, and G. C. Murphy. Explicit programming. In Proceedings of the First International Conference on Aspect-Oriented Software Development, Apr. 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. Büchi and W. Weck. Generic wrappers. In Proceedings of the European Conference on Object-Oriented Programming, pages 201-225, 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. C. Clifton, G. Leavens, C. Chambers, and T. Millstein. MultiJava: Modular open classes and symmetric multiple dispatch for Java. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications '00, pages 130-146, Minneapolis, MN, Oct. 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. K. Czarnecki. Dynamic cool. http://www.prakinf.tu-ilmenau.de/-czarn/aop/sources.tar.gz.]]Google ScholarGoogle Scholar
  12. K. Czarnecki and U. Eisenecker. Generative Programming: Methods, Techniques, and Applications, chapter 8. Addison-Wesley, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. M. Dahm. The byte code engineering library. http://bcel.sourceforge.net.]]Google ScholarGoogle Scholar
  14. P.-C. David, T. Ledoux, and N. N. M. Bouraqadi-Saädani. Two-step weaving with reflection using AspectJ. In OOPSLA Workshop on Advanced Separation of Concerns in Object-Oriented Systems, Oct. 2001.]]Google ScholarGoogle Scholar
  15. M. Flatt, S. Krishnamurthi, and M. Felleisen. Classes and mixins. In Proceedings of the 25th ACM SIGPLAN-SIGACT symposium on Principles of Programming Languages, pages 171-183, 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. M. Goedicke, G. Neumann, and U. Zdun. Design and implemenation constructs for the development of flexible, component-oriented software architectures. In Proceedings of the Second International Symposium on Generative and Component-Based Software Engineering, pages 114-128, 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. S. Henenberg and R. Unland. Using and reusing aspects in AspectJ. In OOPSLA Workshop on Advanced Separation of Concerns in Object-Oriented Systems, Oct. 2001.]]Google ScholarGoogle Scholar
  18. N. D. Hoa. Dynamic aspects in SOFA/DCUP. Technical Report 99/07, Charles University, Prague, Jun. 1999.]]Google ScholarGoogle Scholar
  19. K. Lieberherr, D. Lorenz, and M. Mezini. Programming with aspectual components. Technical Report NU-CCS-99-01, Northeastern University, Apr. 1999.]]Google ScholarGoogle Scholar
  20. C. P. Lunau. A reflective architecture for process control applications. In Proceedings of the European Conference on Object-Oriented Programming, 1997.]]Google ScholarGoogle ScholarCross RefCross Ref
  21. P. Niemeyer. Beanshell --- lightweight scripting for Java. http://www.beanshell.org/.]]Google ScholarGoogle Scholar
  22. K. Ostermann and M. Mezini. Object-oriented composition untangled. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications, Oct. 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. R. Pawlak, L. Seinturier, L. Duchien, and G. Florin. JAC: A flexible solution for aspect-oriented programming in Java. In Reflection 2001, pages 1-24, 2001. LNCS 2192.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. G. Steele Jr. Common Lisp, the Language. Digital Press, second edition, 1990.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. M. Tatsubori, S. Chiba, M. Killijian, and K. Itano. Reflection and Software Engineering, volume 1826 of Lecture Notes in Computer Science, chapter Open Java: a class-based macro system for Java. Springer Verlag, 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Xerox. The AspectJ programming guide. http://www.aspectj_org/doc/dist/progguide/.]]Google ScholarGoogle Scholar

Index Terms

  1. Runtime aspect weaving through metaprogramming

      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
      • Published in

        cover image ACM Other conferences
        AOSD '02: Proceedings of the 1st international conference on Aspect-oriented software development
        April 2002
        162 pages
        ISBN:158113469X
        DOI:10.1145/508386

        Copyright © 2002 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: 22 April 2002

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • Article

        Acceptance Rates

        Overall Acceptance Rate41of139submissions,29%

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader