Skip to main content
Back to USENIX
  • Conferences
  • Students
Sign in

USENIX Conference Policies

  • Event Code of Conduct
  • Conference Network Policy
  • Statement on Environmental Responsibility Policy

Base Class Composition with Multiple Derivation and Virtual Bases

Lee Nackman & John Barton, IBM T.J.Watson Labs

For systems of C++ classes using virtual functions, writing base classes that only specify virtual member functions and then writing other base classes that only implement those functions improves extensibility. When interface is separated from implementation, both interfaces and implementations can be extended separately by derivation. New classes can then be composed by multiple derivation, combining one interface and one implementation base class. We call this form of composition base-class composition. Programmers familiar with the advantages of base-class composition fail to use it because of the performance penalty of multiple derivation and virtual base classes. Consequently, compiler writers, failing to see extensive applications of multiple derivation and virtual bases, have little incentive to eliminate the performance penalty. We highlight the advantages of the base-class composition pattern and show how the performance penalty can be eliminated by compiler optimization.

Lee Nackman, IBM T.J.Watson Labs

John Barton, IBM T.J.Watson Labs

BibTeX
@inproceedings {252332,
author = {Lee Nackman and John Barton},
title = {Base Class Composition with Multiple Derivation and Virtual Bases},
booktitle = {USENIX 6th C++ Technical Conference (USENIX 6th C++ Technical Conference)},
year = {1994},
address = {Cambridge, MA},
url = {https://www.usenix.org/conference/usenix-6th-c-technical-conference/base-class-composition-multiple-derivation-and-virtual},
publisher = {USENIX Association},
month = apr
}
Download

Links

Paper: 
http://usenix.org/publications/library/proceedings/c++94/full_papers/nackman.ps
  • Log in or register to post comments

© USENIX
EIN 13-3055038

  • Privacy Policy
  • Contact Us