Abstract
This paper describes TRAP/C++, a software tool that enables new adaptable behavior to be added to existing C++ programs in a transparent fashion. In previous investigations, we used an aspect-oriented approach to manually define aspects for adaptation infrastructure, which were woven into the original application code at compile time. In follow-on work, we developed TRAP, a transparent shaping technique for automatically generating adaptation aspects, where TRAP/J is a specific instantiation of TRAP. This paper presents our work into building TRAP/C++, which was intended to be a port of TRAP/J into C++. Designing TRAP/C++ required us to overcome two major hurdles: lack of reflection in C++ and the incompatibility between the management of objects in C++ and the aspect weaving technique used in TRAP/J. We used generative programming methods to produce two tools, TrapGen and TrapCC, that work together to produce the desired TRAP/C++ functionality. Details of the TRAP/C++ architecture and operation are presented, which we illustrate with a description of a case study that adds dynamic auditing capabilities to an existing distributed C++ application.
- V. Adve, V. V. Lam, and B. Ensink. Language and compiler support for adaptive distributed applications. In Proc. ACM SIGPLAN workshop on Languages, compilers and tools for embedded systems, pages 238--246. ACM Press, 2001.]] Google ScholarDigital Library
- M. Aksit, L. Bergmans, and S. Vural. An object-oriented language-database integration model: The composition-filters approach. In Proc. European Conference on Object-Oriented Programming (ECOOP), pages 372--395. Springer-Verlag, 1992.]] Google ScholarDigital Library
- G. Blair, G. Coulson, and N. Davies. Adaptive middleware for mobile multimedia applications. In Proc. 7th International Workshop on Network and Operating System Support for Digital Audio and Video (NOSSDAY 97), pages 259--273, 1997.]]Google ScholarCross Ref
- S. Chiba. A metaobject protocol for C++. In Proc. Conference on Object-oriented programming systems, languages, and applications (OOPSLA), pages 285--299. ACM Press, 1995.]] Google ScholarDigital Library
- S. Chiba and T. Masuda. Designing an extensible distributed language with a meta-level architecture. In ECOOP, pages 482--501. Springer-Verlag, 1993.]] Google ScholarDigital Library
- K. Czarnecki and U. W. Eisenecker. Generative Programming: Methods, Tools, and Applications. ACM Press/Addison-Wesley Publishing Co., 2000.]] Google ScholarDigital Library
- P. C. David, T. Ledoux, and N. M. N. Bouraqadi-Saadani. Two-step weaving with reflection using AspectJ. In OOPSLA Workshop on Advanced Separation of Concerns in Object-Oriented Systems, 2001.]]Google Scholar
- J. de Oliveira Guimarães. Reflection for statically typed languages. In ECOOP, pages 440--461. Springer-Verlag, 1998.]] Google ScholarDigital Library
- E. B. Duffy, J. P. Gibson, and B. A. Malloy. Applying the decorator pattern for profiling object-oriented software. In IWPC, pages 84--93, 2003.]] Google ScholarDigital Library
- J. Ferber. Computational reflection in class based object-oriented languages. In OOPSLA, pages 317--326. ACM Press, 1989.]] Google ScholarDigital Library
- E. Gamma, R. Helm, R. Johnson, and J. Vlisside. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Reading, Massachusetts, 1995.]] Google ScholarDigital Library
- M. Golm and J. Kleinoder. metaXa and the future of reflection. In OOPSLA Workshop on Reflective Programming in C++ and Java, pages 1--5, 1998.]]Google Scholar
- G. Hjalmtysson and R. Gray. Dynamic C++ classes---A lightweight mechanism to update code in a running program. In USENIX Annual Technical Conf., pages 65--76, June 1998.]] Google ScholarDigital Library
- E. P. Kasten, P. K. McKinley, S. M. Sadjadi, and R. E. K. Stirewalt. Separating introspection and intercession in metamorphic distributed systems. In Proc. IEEE Workshop on Aspect-Oriented Programming for Distributed Computing (with ICDCS'02), Vienna, Austia, July 2002.]] Google ScholarDigital Library
- G. Kiczales, E. Hilsdale, J. Hugunin, M. Kersten, J. Palm, and W. G. Griswold. An overview of aspectj. In ECOOP, pages 327--353. Springer-Verlag, 2001.]] Google ScholarDigital Library
- G. Kiczales, J. Lamping, A. Mendhekar, C. Maeda, C. V. Lopes, J.-M. Loingtier, and J. Irwin. Aspect-oriented programming. In ECOOP, June 1997.]]Google ScholarCross Ref
- P. Maes. Concepts and experiments in computational reflection. In OOPSLA, pages 147--155. ACM Press, 1987.]] Google ScholarDigital Library
- P.K. McKinley, S. M. Sadjadi, E. P. Kasten, and B. H. C. Cheng. Composing adaptive software. IEEE Computer, 37(7):56--64, July 2004.]] Google ScholarDigital Library
- A. Oliva and L. E. Buzato. The implementation of Guaraná on Java. Technical Report IC-98-32, Universidade Estadual de Campinas, September 1998.]]Google Scholar
- A. Popovici, T. Gross, and G. Alonso. Dynamic homogeneous AOP with PROSE. Technical report, Department of Computer Science, Federal Institute of Technology, Zurich, Switzerland, March 2001.]]Google Scholar
- B. Redmond and V. Cahill. Supporting unanticipated dynamic adaptation of application behaviour. In ECOOP, pages 205--230. Springer-Verlag, 2002.]] Google ScholarDigital Library
- S. M. Sadjadi, P. K. McKinley, B. H. C. Cheng, and R. E. K. Stirewalt. TRAP/J: Transparent generation of adaptable java programs. In Proc. 2004 International Symposium on Distributed Objects and Applications, Agia Napa, Cyprus, October 2004.]]Google ScholarCross Ref
- S. M. Sadjadi, P. K. McKinley, R. E. K. Stirewalt, and B. H. C. Cheng. Generation of self-optimizing wireless network applications. In Proc. International Conference on Autonomic Computing (ICAC-04), New York, NY, May 2004.]] Google ScholarDigital Library
- É. Tanter, J. Noyé, D. Caromel, and P. Cointe. Partial behavioral reflection: spatial and temporal selection of reification. In OOPSLA, pages 27--46. ACM Press, 2003.]] Google ScholarDigital Library
- M. Tatsubori, S. Chiba, K. Itano, and M.-O. Killijian. Openjava: A class-based macro system for java. In Proc. 1st OOPSLA Workshop on Reflection and Software Engineering, pages 117--133. Springer-Verlag, 2000.]] Google ScholarDigital Library
- Z. Yang, B. H. C. Cheng, R. E. K. Stirewalt, J. Sowell, S. M. Sadjadi, and P. K. McKinley. An aspect-oriented approach to dynamic adaptation. In Proc. ACM SIGSOFT Workshop on Self-Healing Systems (WOSS02), Charleston, South Carolina, November 2002.]] Google ScholarDigital Library
Index Terms
- An approach to implementing dynamic adaptation in C++
Recommendations
An approach to implementing dynamic adaptation in C++
DEAS '05: Proceedings of the 2005 workshop on Design and evolution of autonomic application softwareThis paper describes TRAP/C++, a software tool that enables new adaptable behavior to be added to existing C++ programs in a transparent fashion. In previous investigations, we used an aspect-oriented approach to manually define aspects for adaptation ...
Transparent shaping of existing software to support pervasive and autonomic computing
The need for adaptability in software is growing, driven in part by the emergence of pervasive and autonomic computing. In many cases, it is desirable to enhance existing programs with adaptive behavior, enabling them to execute effectively in dynamic ...
Transparent shaping of existing software to support pervasive and autonomic computing
DEAS '05: Proceedings of the 2005 workshop on Design and evolution of autonomic application softwareThe need for adaptability in software is growing, driven in part by the emergence of pervasive and autonomic computing. In many cases, it is desirable to enhance existing programs with adaptive behavior, enabling them to execute effectively in dynamic ...
Comments