GPCE 2004: Generative Programming and Component Engineering pp 55-74 | Cite as
Generic Advice: On the Combination of AOP with Generative Programming in AspectC++
Abstract
Besides object-orientation, generic types or templates and aspect-oriented programming (AOP) gain increasing popularity as they provide additional dimensions of decomposition. Most modern programming languages like Ada, Eiffel, and C++ already have built-in support for templates. For Java and C# similar extensions will be available in the near future. Even though promising, the combination of aspects with generic and generative programming is still a widely unexplored field. This paper presents our extensions to the AspectC++ language, an aspect-oriented C++ derivate. By these extensions aspects can now affect generic code and exploit the potentials of generic code and template metaprogramming in their implementations. This allows aspects to inject template metaprograms transparently into the component code. A case study demonstrates that this feature enables the development of highly expressive and efficient generic aspect implementations in AspectC++. A discussion whether these concepts are applicable in the context of other aspect-oriented language extensions like AspectJ rounds up our contribution.
Keywords
Generic Advice Template Parameter Template Class Advice Code Aspect LanguagePreview
Unable to display preview. Download preview PDF.
References
- 1.Loki: A C++ library of designs, containing flexible implementations of common design patterns and idioms, http://sourceforge.net/projects/loki-lib/
- 2.Alexandrescu, A.: Modern C++ Design: Genenric Programming and Design Patterns Applied. Addison-Wesley, Reading (2001) ISBN 0-20-17043-15Google Scholar
- 3.Alexandrescu, A.: Aspect-Oriented Programming in C++. In: Tutorial held on the 17th ACMSIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2002) (November 2002)Google Scholar
- 4.Austin, C.: J2SE 1.5 in a Nutshell. Technical report, Sun Microsystems, Inc. (February 2004), http://java.sun.com/developer/technicalArticles/releases/j2se15
- 5.Bagge, O.S., Kalleberg, K.T., Haveraaen, M., Visser, E.: Design of the CodeBoost transformation system for domain-specific optimisation of C++ programs. In: Binkley, D., Tonella, P. (eds.) Third International Workshop on Source Code Analysis and Manipulation (SCAM 2003), The Netherlands, September 2003, pp. 65–75. IEEE Computer Society Press, Amsterdam (2003)CrossRefGoogle Scholar
- 6.Bracha, G., Cohen, N., et al.: Adding Generics to the Java Programming Language: Participant Draft Specification. Technical Report JSR-000014, Java Community Process (April 2002), http://jcp.org/aboutJava/communityprocess/review/jsr014/index.html
- 7.Chiba, S.: Metaobject Protocol for C++. In: Proceedings of the ACM Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA), pp. 285–299 (October 1995)Google Scholar
- 8.Czarnecki, K., Dominick, L., Eisenecker, U.W.: Aspektorientierte Programmierung in C++, Teil 1–3. iX, Magazin für professionelle Informationstechnik, pp. 8–10 (2001)Google Scholar
- 9.Czarnecki, K., Eisenecker, U.W.: Generative Programming. Methods, Tools and Applications, May 2000. Addison-Wesley, Reading (2000) ISBN 0-20-13097-77Google Scholar
- 10.Diggins, C.: Aspect-Oriented Programming & C++. Dr. Dobb’s Journal of Software Tools 408(8) (August 2004)Google Scholar
- 11.Garcia, R., Järvi, J., Lumsdaine, A., Siek, J., Willcock, J.: A comparative study of language support for generic programming. In: Proceedings of the 18th Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA 2003), Anaheim, CA, USA, October 2003, pp. 115–134 (2003)Google Scholar
- 12.Kennedy, A., Syme, D.: The design and implementation of generics for the.NET Common Language Runtime. In: Proceedings of the ACM Sigplan Conference on Programming Language Design and Implementation (PLDI 2001) (June 2001)Google Scholar
- 13.Kiczales, G., Hilsdale, E., Hugonin, J., Kersten, M., Palm, J., Griswold, W.G.: An overview of AspectJ. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, p. 327. Springer, Heidelberg (2001)CrossRefGoogle Scholar
- 14.Kim, H.: AspectC#: An AOSD implementation for C#. Master’s thesis, Trinity College, Dublin, Ireland (September 2002)Google Scholar
- 15.Lafferty, D., Cahill, V.: Language-independent aspect-oriented programming. In: Proceedings of the 18th Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA 2003), Anaheim, CA, USA, October 2003, pp. 1–12 (2003)Google Scholar
- 16.Schupp, S., Gregor, D., Musser, D.R., Liu, S.-M.: Semantic and behavioral library transformations. Information and Software Technology 44(13), 797–810 (2002)CrossRefGoogle Scholar
- 17.Spinczyk, O., Gal, A., Schröder-Preikschat, W.: AspectC++: An Aspect- Oriented Extension to C++. In: Proceedings of the 40th International Conference on Technology of Object-Oriented Languages and Systems (TOOLS Pacific 2002), Sydney, Australia, February 2002, pp. 53–60 (2002)Google Scholar
- 18.Veldhuizen, T.: Template metaprograms. C++ Report (May 1995)Google Scholar
- 19.Veldhuizen, T., Ponnambalam, K.: Linear algebra with C++ template metaprograms. Dr. Dobb’s Journal of Software Tools 21(8), 38–44 (1996)Google Scholar