Computing Reviews

Systematically refactoring inheritance to delegation in Java
Kegel H., Steimann F.  Software engineering (Proceedings of the 13th International Conference on Software Engineering, Leipzig, Germany, May 10-18, 2008)431-440,2008.Type:Proceedings
Date Reviewed: 08/27/08

Choosing between class inheritance and object delegation has been the topic of countless debates in the object-oriented (OO) programming community. This tension is the result of an overloading of the class inheritance mechanism [1]. Opting for a delegation instead of an inheritance gives more control to the programmer over operations that may be invoked, without bloating class interfaces.

Techniques to replace class inheritance with object delegation have already been proposed, however, none of them have been properly formalized and associated to an automatic-code transformation engine. Such a transformation is far from being trivial since many subtleties related to subtyping have to be taken into account. This is discussed in this paper.

Practitioners and researchers interested in the field of class inheritance and behavior composition will find this paper appealing, due to the accuracy of the analysis and reflection. Recently, there has been a resurgence of alternatives to class inheritance, such as mixins [2] and traits [3] that usually imply code migration [4]. It is likely that we will see applications of the results presented in this paper.


1)

LaLonde, W.; Pugh, J. Smalltalk: subclassing subtyping is-a. Journal of Object-Oriented Programming 3, 5(1991), 57–62.


2)

Bracha, G.; Cook, W. Mixin-based inheritance. In Conference on Object Oriented Programming Systems Languages and Applications ACM, 1990, 303–311.


3)

Ducasse, S.; Nierstrasz, O.; Schärli, N.; Wuyts, R.; Black, A.P. Traits: a mechanism for fine-grained reuse. ACM Transactions on Programming Languages and Systems (TOPLAS) 28, 2(2006), 331–388.


4)

Cassou, D.; Ducasse , S.; Wuyts, R. Redesigning with traits: the Nile stream trait-based library. In 2007 international conference on Dynamic languages: in conjunction with the 15th International Smalltalk Joint Conference ACM, 2007, 50–75.

Reviewer:  Alexandre Bergel Review #: CR135998 (0910-0945)

Reproduction in whole or in part without permission is prohibited.   Copyright 2024 ComputingReviews.com™
Terms of Use
| Privacy Policy