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.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Colnet, D., Ribet, P., Adrian, C., Croizier, V., Merizen, F.: Web site of SmartEiffel, the gnu Eiffel compiler, tools and libraries, http://SmartEiffel.loria.fr
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)
Cook, W., Hill, W., Canning, P.: Inheritance is Not Subtyping. In: 17th ACM Symposium on Principles of Programming Languages, pp. 125–135 (1990)
ECMA Normalisation group for the Eiffel language definition TC39-TG4, http://www.ecma-international.org/memento/TC39-TG4.html
Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addisson-Wesley, Reading (1995)
Goldberg, A., Robson, D.: Smalltalk-80, the Language and its Implementation. Addison-Wesley, Reading (1983)
Gomes, B., Stoutamire, D., Vaysman, B., Klawitter, H.: Sather 1.1: A language manual, http://www.icsi.berkeley.edu/~sather
Jézéquel, J.M., Train, M., Mingins, C.: Design Patterns and Contracts. Addison Wesley, Reading (1999)
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)
Meyer, B.: Reusable Software. Prentice Hall, Englewood Cliffs (1994)
Meyer, B.: Beware of polymorphic catcalls, http://archive.eiffel.com
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)
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)
Stroustrup, B.: The C++ Programming Language. Addison Wesley, Reading (2000)
Thomas, D., Hunt, A.: Programming Ruby: The Pragmatic Programmer’s Guide. Addison-Wesley, Reading (2001)
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)
Zendra, O., Colnet, D.: Coping with aliasing in the GNU Eiffel Compiler implementation. Software Practice and Experience (SP&E) 31(6), 601–613 (2001)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2006 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Colnet, D., Marpons, G., Merizen, F. (2006). Reconciling Subtyping and Code Reuse in Object-Oriented Languages: Using inherit and insert in SmartEiffel, the GNU Eiffel Compiler. In: Morisio, M. (eds) Reuse of Off-the-Shelf Components. ICSR 2006. Lecture Notes in Computer Science, vol 4039. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11763864_15
Download citation
DOI: https://doi.org/10.1007/11763864_15
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-34606-7
Online ISBN: 978-3-540-34607-4
eBook Packages: Computer ScienceComputer Science (R0)