Reconciling subtyping and code reuse in object-oriented languages: using inherit and insert in smarteiffel, the GNU eiffel compiler

  • Authors:
  • Dominique Colnet;Guillem Marpons;Frederic Merizen

  • Affiliations:
  • LORIA (UMR 7503 CNRS-INPL-INRIA-Nancy2-UHP), France;Universitat Politècnica de Catalunya (UPC), Spain;LORIA (UMR 7503 CNRS-INPL-INRIA-Nancy2-UHP), France

  • Venue:
  • ICSR'06 Proceedings of the 9th international conference on Reuse of Off-the-Shelf Components
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

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.