Abstract
Separation of concerns and collaboration based design is usually a suitable concept for library implementation: it results in easily scalable and maintainable code. After specifying and implementing orthogonal features, we aim to easily assemble library components. In real life, components can be used only after appropriate refinement steps, progressively adding features in each step. Therefore the specific solution for a particular task can be produced by composing a set of refined components. Unfortunately, a subtype anomaly occurs in object-oriented languages between such composite components that have different numbers of features from different refinement stages. In this article we analyse this anomaly that we named chevron-shape inheritance and present a framework based on standard C++ template metaprogramming.
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Zólyomi, I., Porkoláb, Z., Kozsik, T.: An extension to the subtype relationship in C++. In: Pfenning, F., Smaragdakis, Y. (eds.) GPCE 2003. LNCS, vol. 2830, pp. 209–227. Springer, Heidelberg (2003)
Alexandrescu, A.: Modern C++ Design: Generic Programming and Design Patterns Applied. Addison-Wesley, Reading (2001)
Vandevoorde, D., Josuttis, N.M.: C++ Templates: The Complete Guide. Addison-Wesley, Reading (2003)
Baumgartner, G., Russo, V.F.: Implementing Signatures for C++. ACM Transactions on Programming Languages and Systems (TOPLAS) 19(1), 153–187 (1997)
Veldhuizen, T.: Using C++ Template Metaprograms. C++ Report 7(4), 36–43 (1995)
Veldhuizen, T.: Expression Templates. C++ Report 7(5), 26–31 (1995)
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 ACM SIGPLAN OOPSLA 2003, pp. 115–134 (2003)
Leroy, X., et al.: The Objective Caml system, release 3.0.8, documentation and user’s manual (July 2004), http://caml.inria.fr/ocaml/htmlman/index.html
Jeremy Siek, J.: A Language for Generic Programming. PhD thesis, Indiana University (August 2005)
Don Batory, A.: Tutorial on Feature Oriented Programming and the AHEAD Tool Suite. Technical Report, TR-CCTC/DI-35, GTTSE, pp. 153–186 (2005)
Batory, D., Sarvela, J.N., Rauschmayer, A.: Scaling Step-Wise Refinement. IEEE Transactions on Software Engineering 30(6), 355–371
Batory, D., Liu, J., Sarvela, J.N.: Refinements and multi-dimensional separation of concerns. In: Proceedings of the 9th European Software Engineering Conference (2003)
Smaragdakis, Y., Batory, D.: Mixin-Based Programming in C++. In: Proceedings of Net.Object Days 2000, pp. 464–478 (2000)
Smaragdakis, Y., Batory, D.: Mixin Layers: An Object-Oriented Implementation Technique for Refinements and Collaboration-Based Designs. ACM Transactions of Software Engineering and Methodology 11(2), 215–255 (2002)
Czarnecki, K., Eisenecker, U.W.: Generative Programming: Methods, Tools and Applications. Addison-Wesley, Reading (2000)
Stroustrup, B.: The C++ Programming Language Special Edition. Addison-Wesley, Reading (2000)
Stroustrup, B.: The Design and Evolution of C++. Addison-Wesley, Reading (1994)
Bertrand Meyer: Eiffel: The Language. Prentice Hall, Englewood Cliffs (1991)
Bergmans, L., Aksit, M.: Composing Crosscutting Concerns Using Composition Filters. Communications of the ACM 44(10), 51–57 (2001)
Cardelli, L.: Structural Subtyping and the Notion of Power Type. In: Conference Record of the Fifteenth Annual ACM Symposium on Principles of Programming Languages, San Diego, California, January 1988, pp. 70–79 (1988)
Kiczales, G., Lamping, J., Mendhekar, A., Maeda, C., Lopes, C.V., Loingtier, J.-M., Irwin, J.: Aspect-Oriented Programming. In: Aksit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 220–242. Springer, Heidelberg (1997)
Kiczales, G., et al.: An overview of AspectJ. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 327–355. Springer, Heidelberg (2001)
Baumgartner, G., Jansche, M., Läufer, K.: Half & Half: Multiply Dispatch and Retroactive Abstraction for Java. Technical Report OSU-CISRC-5/01-TR08. Ohio State University (2002)
Eisenecker, U.W., Blinn, F., Czarnecki, K.: A Solution to the Constructor-Problem of Mixin-Based Programming in C++. In: The GCSE, Workshop on C++ Template Programming (2000)
Ossher, H., Tarr, P.: Multi-Dimensional Separation of Concerns and The Hyperspace Approach. IBM Research Report 21452, IBM T.J. Watson Research Center (April 1999), http://www.research.ibm.com/hyperspace/Papers/tr21452.ps
Ossher, H., Tarr, P.: Hiper/J. Multidemensional Separation of Concerns for Java. In: International Conference on Software Engineering 2001, pp. 734–737. ACM, New York (2001)
Harrison, W., Ossher, H.: Subject-oriented programming: a critique of pure objects. In: Proceedings of 8th OOPSLA 1993, Washington D.C., USA, pp. 411–428 (1993)
Subject Oriented Programming, http://www.research.ibm.com/sop
Shopiro, J.E.: An Example of Multiple Inheritance in C++: a Model of the Iostream Library. ACM SIGPLAN Notices (December 1989)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2006 Springer-Verlag Berlin Heidelberg
About this chapter
Cite this chapter
Porkoláb, Z., Zólyomi, I. (2006). A Feature Composition Problem and a Solution Based on C++ Template Metaprogramming. 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_21
Download citation
DOI: https://doi.org/10.1007/11877028_21
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)