An Extension to the Subtype Relationship in C++ Implemented with Template Metaprogramming

Families of independent classes, where each class represents a separate, orthogonal concern are highly attractive for implementing collaboration-based design. However, required subtype relationship between such families cannot be expressed in many programming languages. This paper presents a framework to handle collaborating groups of classes using template metaprogramming based on standard C++ features in the style of Loki::Typelist. Our solution provides tailor-made implicit conversion rules between appropriate groups, inclusion polymorphism and a tool for dynamic binding.

[1]  Bjarne Stroustrup,et al.  The C++ Programming Language: Special Edition , 2000 .

[2]  Gregor Kiczales,et al.  Aspect-oriented programming , 2001, ESEC/FSE-9.

[3]  Jens Palsberg,et al.  Foundations of object-oriented languages , 1994, SIGP.

[4]  Lodewijk Bergmans,et al.  Composing crosscutting concerns using composition filters , 2001, CACM.

[5]  Harold Ossher,et al.  Multi-Dimensional Separation of Concerns and the Hyperspace Approach , 2002 .

[6]  Yannis Smaragdakis,et al.  Mixin-Based Programming in C++ , 2000, GCSE.

[7]  Andrei Alexandrescu,et al.  Modern C++ design: generic programming and design patterns applied , 2001 .

[8]  Luca Cardelli,et al.  Structural subtyping and the notion of power type , 1988, POPL '88.

[9]  Satoshi Matsuoka,et al.  ECOOP'97 — Object-Oriented Programming , 1997, Lecture Notes in Computer Science.

[10]  Krzysztof Czarnecki,et al.  Generative programming - methods, tools and applications , 2000 .

[11]  Krzysztof Czarnecki,et al.  A Solution to the Constructor-Problem of Mixin-Based Programming in C++ , 2000 .

[12]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[13]  Cristina V. Lopes,et al.  Aspect-oriented programming , 1999, ECOOP Workshops.

[14]  Kim B. Bruce Foundations of object-oriented languages - types and semantics , 2002 .

[15]  Vincent F. Russo,et al.  Lingua-Franca: An IDL for Structural Subtyping Distributed Object Systems , 1995, COOTS.

[16]  Wolfgang Schröder-Preikschat,et al.  AspectC++: an aspect-oriented extension to the C++ programming language , 2002 .