Abstract
Combinations of C++ features, like inheritance, templates, and class nesting, allow for the expression of powerful component patterns. In particular, research has demonstrated that, using C++ mixin classes, one can express layered component-based designs concisely with efficient implementations. In this paper, we discuss pragmatic issues related to component-based programming using C++ mixins. We explain surprising interactions of C++ features and policies that sometimes complicate mixin implementations, while other times enable additional functionality without extra effort.
We gratefully acknowledge the sponsorship of Microsoft Research, the Defense Advanced Research Projects Agency (Cooperative Agreement F30602-96-2-0226), and the University of Texas at Austin Applied Research Laboratories.
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
ANSI / ISO Standard: Programming Languages-C++, ISO/IEC 14882, 1998.
J. Barton and L. R. Nackman, Scientific and Engineering C++: An Introduction with Advanced Techniques and Applications, Addison-Wesley, 1994.
D. Batory, V. Singhal, M. Sirkin, and J. Thomas, “Scalable Software Libraries”, ACM SIGSOFT1993.
D. Batory, R. Cardone, and Y. Smaragdakis, “Object-Oriented Frameworks and Product-Lines”, 1st Software Product-Line Conference, Denver, Colorado, August 1999.
K. Beck and W. Cunningham, “A Laboratory for Teaching Object-Oriented Thinking”, OOPSLA1989, 1–6.
G. Bracha and W. Cook, “Mixin-Based Inheritance”, ECOOP/OOPSLA 90, 303–311.
G. Bracha, M. Odersky, D. Stoutamire and P. Wadler, “Making the future safe for the past: Adding Genericity to the Java Programming Language”, OOPSLA 98.
P. Canning, W. Cook, W. Hill, W. Olthoff, and J. C. Mitchell, “F-bounded Polymorphism for Object-Oriented Programming”, in Proc. Conf. on Functional Programming Languages and Computer Architecture, 1989, 273–280.
J. Coplien, “Curiously Recurring Template Patterns”, C++ Report, 7(2):24–27, Feb. 1995.
K. Czarnecki and U. Eisenecker. Generative Programming: Methods, Tools, and Applications. Addison-Wesley, 2000.
K. Czarnecki and U. Eisenecker, “Synthesizing Objects”, ECOOP1999, 18–42.
U. Eisenecker, “Generative Programming in C++”, in Proc. Joint Modular Languages Conference (JMLC’97), LNCS1204, Springer, 1997, 351–365.
M. A. Ellis and B. Stroustrup, The Annotated C++ Reference Manual, Addison-Wesley, 1990.
E. Gamma, R. Helm, R. Johnson, and J. Vlissides, Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, 1994.
R. Helm, I. Holland, and D. Gangopadhyay, “Contracts: Specifying Behavioral Compositions in Object-Oriented Systems”. OOPSLA1990, 169–180.
I. Holland, “Specifying Reusable Components Using Contracts”, ECOOP1992, 287–308.
R. Johnson and B. Foote, “Designing Reusable Classes”, J. of Object-Oriented Programming, 1(2): June/July 1988, 22–35.
G. Kiczales, J. des Rivieres, and D. G. Bobrow, The Art of the Metaobject Protocol. MIT Press, 1991.
O. L. Madsen, B. Møller-Pedersen, and K. Nygaard, Object-Oriented Programming in the BETA Programming Language. Addison-Wesley, 1993.
D. A. Moon, “Object-Oriented Programming with Flavors”, OOPSLA1986.
T. Reenskaug, E. Anderson, A. Berre, A. Hurlen, A. Landmark, O. Lehne, E. Nordhagen, E. Ness-Ulseth, G. Oftedal, A. Skaar, and P. Stenslet, “OORASS: Seamless Support for the Creation and Maintenance of Object-Oriented Systems”, J. of Object-Oriented Programming, 5(6): October 1992, 27–41.
Silicon Graphics Computer Systems Inc., STL Programmer’s Guide. See: http://www.sgi.com/Technology/STL/.
V. Singhal, A Programming Language for Writing Domain-Specific Software System Generators, Ph. D. Dissertation, Dep. of Computer Sciences, University of Texas at Austin, August 1996.
Y. Smaragdakis and D. Batory, “Implementing Reusable Object-Oriented Components”. In the 5th Int. Conf. on Software Reuse (ICSR 98).
Y. Smaragdakis and D. Batory, “Implementing Layered Designs with Mixin Layers”. In ECOOP 98.
Y. Smaragdakis, “Implementing Large-Scale Object-Oriented Components”, Ph. D. Dissertation, Department of Computer Sciences, University of Texas at Austin, December 1999.
A. Stepanov and M. Lee, “The Standard Template Library”. Incorporated in ANSI/ISO Committee C++ Standard.
B. Stroustrup, The C++ Programming Language, 3rd Ed., Addison-Wesley, 1997.
M. VanHilst and D. Notkin, “Using C++ Templates to Implement Role-Based Designs”. JSSST International Symposium on Object Technologies for Advanced Software, Springer-Verlag, 1996, 22–37.
M. VanHilst and D. Notkin, “Using Role Components to Implement Collaboration-Based Designs”. OOPSLA1996.
M. VanHilst and D. Notkin, “Decoupling Change From Design”, SIGSOFT 96.
P. Wadler, M. Odersky and Y. Smaragdakis, “Do Parametric Types Beat Virtual Types?”, unpublished manuscript, posted in October 1998 in the Java Genericity mailing list (java-genericity@cs.rice.ed).
K. Weihe, “A Software Engineering Perspective on Algorithmics”, available at http://www.informatik.uni-konstanz.de/Preprints/.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2001 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Smaragdakis, Y., Batory, D. (2001). Mixin-Based Programming in C++. In: Butler, G., Jarzabek, S. (eds) Generative and Component-Based Software Engineering. GCSE 2000. Lecture Notes in Computer Science, vol 2177. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-44815-2_12
Download citation
DOI: https://doi.org/10.1007/3-540-44815-2_12
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-42578-6
Online ISBN: 978-3-540-44815-0
eBook Packages: Springer Book Archive