Reconciling Subtyping and Code Reuse in Object-Oriented Languages: Using inherit and insert in SmartEiffel, the GNU Eiffel Compiler

  • Dominique Colnet
  • Guillem Marpons
  • Frederic Merizen
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4039)


SmartEiffel has been enjoying two different mechanisms to express subtyping and implementation inheritance for one year. After large scale practical tests and thanks to user feedback, this paper finalises the new typing policy of SmartEiffel, which combines two forms of multiple inheritance with genericity in one statically-checked, object-oriented language.

Having two forms of inheritance allows the designer to capture more design decisions in the source code. It is now straightforward to share reusable code between otherwise unrelated types. The new mechanism allows to reuse code from an existing class without polluting the reuser’s interface. It also enables an elegant implementation of some design patterns.

Furthermore, this mechanism helps compilers to statically remove more dynamic dispatch code. It can also be used to add a no-penalty and no-risk multiple-inheritance-like construct to a single-inheritance language such as Java.


Design Pattern Typing Policy Class Vector Exportation Status Multiple Inheritance 
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.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Colnet, D., Ribet, P., Adrian, C., Croizier, V., Merizen, F.: Web site of SmartEiffel, the gnu Eiffel compiler, tools and libraries,
  2. 2.
    Colnet, D., Coucaud, P., Zendra, O.: Compiler Support to Customize the Mark and Sweep Algorithm. In: 1st ACM SIGPLAN International Symposium on Memory Management (ISMM 1998), Vancouver, BC, Canada, pp. 154–165 (1998)Google Scholar
  3. 3.
    Cook, W., Hill, W., Canning, P.: Inheritance is Not Subtyping. In: 17th ACM Symposium on Principles of Programming Languages, pp. 125–135 (1990)Google Scholar
  4. 4.
    ECMA Normalisation group for the Eiffel language definition TC39-TG4,
  5. 5.
    Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addisson-Wesley, Reading (1995)Google Scholar
  6. 6.
    Goldberg, A., Robson, D.: Smalltalk-80, the Language and its Implementation. Addison-Wesley, Reading (1983)MATHGoogle Scholar
  7. 7.
    Gomes, B., Stoutamire, D., Vaysman, B., Klawitter, H.: Sather 1.1: A language manual,
  8. 8.
    Jézéquel, J.M., Train, M., Mingins, C.: Design Patterns and Contracts. Addison Wesley, Reading (1999)Google Scholar
  9. 9.
    Keedy, J.L., Heinlein, C., Menger, G.: Reuse Variables: Reusing Code and State in Timor. In: Bosch, J., Krueger, C. (eds.) ICOIN 2004 and ICSR 2004. LNCS, vol. 3107, pp. 205–214. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  10. 10.
    Meyer, B.: Reusable Software. Prentice Hall, Englewood Cliffs (1994)Google Scholar
  11. 11.
    Meyer, B.: Beware of polymorphic catcalls,
  12. 12.
    Ribet, P., Adrian, C., Zendra, O., Colnet, D.: Conformance of agents in the Eiffel language. Journal of Object Technology (JOT) 3(4), 125–143 (2004)CrossRefGoogle Scholar
  13. 13.
    Schärli, N., Ducasse, S., Nierstrasz, O., Black, A.: Traits: Composable Units of Behavior. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743, pp. 248–274. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  14. 14.
    Stroustrup, B.: The C++ Programming Language. Addison Wesley, Reading (2000)Google Scholar
  15. 15.
    Thomas, D., Hunt, A.: Programming Ruby: The Pragmatic Programmer’s Guide. Addison-Wesley, Reading (2001)Google Scholar
  16. 16.
    Zendra, O., Colnet, D., Collin, S.: Efficient Dynamic Dispatch without Virtual Function Tables. The SmallEiffel Compiler. In: OOPSLA 1997, 12th ACM Conference on Object-Oriented Programming Systems, Languages and Applications, pp. 125–141 (1997)Google Scholar
  17. 17.
    Zendra, O., Colnet, D.: Coping with aliasing in the GNU Eiffel Compiler implementation. Software Practice and Experience (SP&E) 31(6), 601–613 (2001)MATHCrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Dominique Colnet
    • 1
  • Guillem Marpons
    • 2
  • Frederic Merizen
    • 1
  1. 1.LORIA (UMR 7503 CNRS-INPL-INRIA-Nancy2-UHP)France
  2. 2.Universitat Politècnica de Catalunya (UPC)Spain

Personalised recommendations