DocumentCode :
492601
Title :
Systematically refactoring inheritance to delegation in java
Author :
Kegel, Hannes ; Steimann, Friedrich
Author_Institution :
ej-Technol. GmbH, Munich
fYear :
2008
fDate :
10-18 May 2008
Firstpage :
431
Lastpage :
440
Abstract :
Because of the strong coupling of classes and the proliferation of unneeded class members induced by inheritance, the suggestion to use composition and delegation instead has become common place. The presentation of a corresponding refactoring in the literature may lead one to believe that such a transformation is a straightforward undertaking. However, closer analysis reveals that this refactoring is neither always possible, nor does it necessarily achieve its desired effect. We have therefore identified the necessary preconditions and realizable postconditions of the refactoring, and built a tool that can perform it completely automatically. By applying this tool to all subclasses of several open-source projects, we have collected evidence of the applicability of the refactoring and of its capability to deliver on its promises. The refactoring builds on constraint graphs originally developed for type inference to check the preconditions and to compute the necessary delegation as well as the subtype relationships that must be maintained.
Keywords :
Java; graph theory; object-oriented programming; software maintenance; Java; constraint graphs; object-oriented programming; refactoring inheritance; Computer languages; Concrete; Frequency; Java; Object oriented programming; Open source software; Performance analysis; Reflection; Software engineering; delegation; design; evaluation; forwarding; inheritance; open recursion; refactoring;
fLanguage :
English
Publisher :
ieee
Conference_Titel :
Software Engineering, 2008. ICSE '08. ACM/IEEE 30th International Conference on
Conference_Location :
Leipzig
ISSN :
0270-5257
Print_ISBN :
978-1-4244-4486-1
Electronic_ISBN :
0270-5257
Type :
conf
DOI :
10.1145/1368088.1368147
Filename :
4814154
Link To Document :
بازگشت