Skip to main content

Program Transformation with Reflection and Aspect-Oriented Programming

  • Chapter
  • 830 Accesses

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 4143))

Abstract

A meta-programming technique known as reflection can be regarded as a sophisticated programming interface for program transformation. It allows software developers to implement various useful program transformation without serious efforts. Although the range of program transformation enabled by reflection is quite restricted, it covers a large number of interesting applications. In particular, several non-functional concerns found in web-application software, such as distribution and persistence, can be implemented with program transformation by reflection. Furthermore, a recently emerging technology known as aspect-oriented programming (AOP) provides better and easier programming interface than program transformation does. One of the roots of AOP is reflection and thus this technology can be regarded as an advanced version of reflection. In this tutorial, we will discuss basic concepts of reflection, such as compile-time reflection and runtime reflection, and its implementation techniques. The tutorial will also cover connection between reflection and aspect-oriented programming.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Bobrow, D.G., DeMichiel, L.G., Gabriel, R.P., Keene, S.E., Kiczales, G., Moon, D.A.: Common lisp object system specification. Sigplan Notices (1988) (X3J13 Document 88-002R)

    Google Scholar 

  2. Bockisch, C., Haupt, M., Mezini, M., Ostermann, K.: Virtual machine support for dynamic join points. In: Proc. of Int’l Conf. on Aspect-Oriented Software Development (AOSD 2004), pp. 83–92 (2004)

    Google Scholar 

  3. Bracha, G., Ungar, D.: Mirrors: design principles for meta-level facilities of object-oriented programming languages. In: Proc. of ACM Conf. on Object-Oriented Programming Systems, Languages, and Applications, pp. 331–334. ACM, New York (2004)

    Google Scholar 

  4. Cazzola, W.: mcharm: Reflective middleware with a global view of communications. IEEE Distributed System On-Line 3 (2002)

    Google Scholar 

  5. Chiba, S.: A metaobject protocol for C++. In: Proc. of ACM Conf. on Object-Oriented Programming Systems, Languages, and Applications. SIGPLAN Notices, vol. 30(10), pp. 285–299. ACM Press, New York (1995)

    Chapter  Google Scholar 

  6. Chiba, S.: Macro processing in object-oriented languages. In: Proc. of Technology of Object-Oriented Languages and Systems (TOOLS Pacific 1998), pp. 113–126. IEEE Press, Los Alamitos (1998)

    Google Scholar 

  7. Chiba, S.: Load-time structural reflection in Java. In: Bertino, E. (ed.) ECOOP 2000. LNCS, vol. 1850, pp. 313–336. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  8. Chiba, S., Ishikawa, R.: Aspect-oriented programming beyond dependency injection. In: Black, A.P. (ed.) ECOOP 2005. LNCS, vol. 3586, pp. 121–143. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  9. Chiba, S., Masuda, T.: Designing an extensible distributed language with a meta-level architecture. In: Nierstrasz, O. (ed.) ECOOP 1993. LNCS, vol. 707, pp. 482–501. Springer, Heidelberg (1993)

    Chapter  Google Scholar 

  10. Chiba, S., Nishizawa, M.: An easy-to-use toolkit for efficient Java bytecode translators. In: Pfenning, F., Smaragdakis, Y. (eds.) GPCE 2003. LNCS, vol. 2830, pp. 364–376. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  11. Dahm, M.: Byte code engineering with the javaclass api. Techincal Report B-17-98, Institut für Informatik, Freie Universität Berlin (1999)

    Google Scholar 

  12. Ershov, A.: On the essence of compilation. In: Neuhold, E. (ed.) Formal Description of Programming Concepts, pp. 391–420. North-Holland, Amsterdam (1978)

    Google Scholar 

  13. Ferber, J.: Computational reflection in class based object oriented languages. In: Proc. of ACM Conf. on Object-Oriented Programming Systems, Languages, and Applications, pp. 317–326 (1989)

    Google Scholar 

  14. Foote, B., Johnson, R.E.: Reflective facilities in Smalltalk-80. In: Proc. of ACM Conf. on Object-Oriented Programming Systems, Languages, and Applications, pp. 327–335 (1989)

    Google Scholar 

  15. Fowler, M.: Inversion of control containers and the dependency injection pattern (2004), http://www.martinfowler.com/articles/injection.html

  16. Futamura, Y.: Partial computation of programs. In: Goto, E., Nakajima, R., Yonezawa, A., Nakata, I., Furukawa, K. (eds.) Proc. of RIMS Symposia on Software Science and Engineering. LNCS, vol. 147, pp. 1–35. Springer, Heidelberg (1983)

    Google Scholar 

  17. Goldberg, A., Robson, D.: Smalltalk-80: The Language and Its Implementation. Addison-Wesley, Reading (1983)

    MATH  Google Scholar 

  18. Golm, M., Kleinöder, J.: Jumping to the meta level, behavioral reflection can be fast and flexible. In: Cointe, P. (ed.) Reflection 1999. LNCS, vol. 1616, pp. 22–39. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  19. JBoss Inc.: JBoss AOP 1.0.0 final (2004), http://www.jboss.org/

  20. Kiczales, G., des Rivières, J., Bobrow, D.G.: The Art of the Metaobject Protocol. The MIT Press, Cambridge (1991)

    Google Scholar 

  21. Kiczales, G., Lamping, J., Mendhekar, A., Maeda, C., Lopes, C., Loingtier, J., Irwin, J.: Aspect-oriented programming. In: Aksit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 220–242. Springer, Heidelberg (1997)

    Chapter  Google Scholar 

  22. Kiczales, G., Hilsdale, E., Hugunin, J., Kersten, M., Palm, J., Griswold, W.G.: An overview of AspectJ. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 327–353. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  23. Lopes, C.V., Ngo, T.C.: The aspect markup language and its support of aspect plugins. Isr technical report # uci-isr-04-8, University of California, Irvine (2004)

    Google Scholar 

  24. Maes, P.: Concepts and experiments in computational reflection. In: Proc. of ACM Conf. on Object-Oriented Programming Systems, Languages, and Applications, pp. 147–155 (1987)

    Google Scholar 

  25. Masuhara, H., Matsuoka, S., Asai, K., Yonezawa, A.: Compiling away the meta-level in object-oriented concurrent reflective languages using partial evaluation. In: Proc. of ACM Conf. on Object-Oriented Programming Systems, Languages, and Applications, pp. 300–315 (1995)

    Google Scholar 

  26. Masuhara, H., Matsuoka, S., Watanabe, T., Yonezawa, A.: Object-oriented concurrent reflective languages can be implemented efficiently. In: Proc. of ACM Conf. on Object-Oriented Programming Systems, Languages, and Applications, pp. 127–144 (1992)

    Google Scholar 

  27. Masuhara, H., Yonezawa, A.: Design and partial evaluation of meta-objects for a concurrent reflective languages. In: Jul, E. (ed.) ECOOP 1998. LNCS, vol. 1445, pp. 418–439. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  28. McAffer, J.: Meta-level programming with coda. In: Olthoff, W. (ed.) ECOOP 1995. LNCS, vol. 952, pp. 190–214. Springer, Heidelberg (1995)

    Google Scholar 

  29. Mezini, M., Ostermann, K.: Conquering aspects with caesar. In: Proc. of Int’l Conf. on Aspect-Oriented Software Development (AOSD 2003), pp. 90–99. ACM Press, New York (2003)

    Chapter  Google Scholar 

  30. Popovici, A., Gross, T., Alonso, G.: Dynamic weaving for aspect-oriented programming. In: Proc. of Int’l Conf. on Aspect-Oriented Software Development (AOSD 2002), pp. 141–147. ACM Press, New York (2002)

    Chapter  Google Scholar 

  31. Rajan, H., Sullivan, K.J.: Classpects: Unifying aspect- and object-oriented language design. In: Proc. of the 27th International Conference on Software Engineering (ICSE 2005), pp. 59–68. ACM Press, New York (2005)

    Chapter  Google Scholar 

  32. Sakurai, K., Masuhara, H., Ubayashi, N., Matsuura, S., Kimoya, S.: Association aspects. In: Aspect-Oriented Software Development, pp. 16–25 (2004)

    Google Scholar 

  33. Sato, Y., Chiba, S., Tatsubori, M.: A selective, just-in-time aspect weaver. In: Pfenning, F., Smaragdakis, Y. (eds.) GPCE 2003. LNCS, vol. 2830, pp. 189–208. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  34. Smith, B.C.: Reflection and semantics in Lisp. In: Proc. of ACM Symp. on Principles of Programming Languages, pp. 23–35 (1984)

    Google Scholar 

  35. Smith, B.: Reflection and semantics in a procedural languages. Technical Report MIT-TR-272, M.I.T. Laboratory for Computer Science (1982)

    Google Scholar 

  36. Sun Microsystems: Java 2 Platform, Enterprise Edition (J2EE), http://java.sun.com/j2ee/

  37. Suvée, D., Vanderperren, W., Jonckers, V.: Jasco: An aspect-oriented approach tailored for component based software development. In: Proc. of Int’l Conf. on Aspect-Oriented Software Development (AOSD 2003), pp. 21–29. ACM Press, New York (2003)

    Chapter  Google Scholar 

  38. Tatsubori, M., Chiba, S., Killijian, M.O., Itano, K.: Openjava: A class-based macro system for java. In: Cazzola, W., Stroud, R.J., Tisato, F. (eds.) Reflection and Software Engineering. LNCS, vol. 1826, pp. 117–135. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  39. Watanabe, T., Yonezawa, A.: Reflection in an object-oriented concurrent language. In: Proc. of ACM Conf. on Object-Oriented Programming Systems, Languages, and Applications, pp. 306–315 (1988)

    Google Scholar 

  40. Welch, I., Stroud, R.: From dalang to kava — the evolution of a reflective java extension. In: Cointe, P. (ed.) Reflection 1999. LNCS, vol. 1616, pp. 2–21. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2006 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

Chiba, S. (2006). Program Transformation with Reflection and Aspect-Oriented Programming. In: Lämmel, R., Saraiva, J., Visser, J. (eds) Generative and Transformational Techniques in Software Engineering. GTTSE 2005. Lecture Notes in Computer Science, vol 4143. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11877028_3

Download citation

  • DOI: https://doi.org/10.1007/11877028_3

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-45778-7

  • Online ISBN: 978-3-540-46235-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics