ACM Home Page
Please provide us with feedback. Feedback
Systematically refactoring inheritance to delegation in java
Full text PdfPdf (314 KB)
Source
International Conference on Software Engineering archive
Proceedings of the 30th international conference on Software engineering table of contents
Leipzig, Germany
SESSION: Refactoring table of contents
Pages 431-440  
Year of Publication: 2008
ISBN:978-1-60558-079-1
Authors
Hannes Kegel  ej-technologies GmbH, München, Germany
Friedrich Steimann  Fernuniversität in Hagen, Hagen, Germany
Sponsors
ACM: Association for Computing Machinery
SIGSOFT: ACM Special Interest Group on Software Engineering
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): n/a,   Downloads (12 Months): n/a,   Citation Count: 1
Additional Information:

abstract   references   cited by   index terms   review   collaborative colleagues  

Tools and Actions: Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/1368088.1368147
What is a DOI?

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 commonplace. 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.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

1
 
2
3
4
 
5
 
6
RM Fuhrer, F Tip, A Kiezun, J Dolby, M Keller "Efficiently refactoring Java applications to use generic libraries" in: Proc. of ECOOP (2005) 71--96.
 
7
 
8
T Genssler, B Schulz "Transforming inheritance into composition - A reengineering pattern" in: Pro. of 4th EuroPLoP (1999).
 
9
 
10
M Grand Patterns in Java 2nd edition (Wiley & Sons 2002).
11
12
 
13
IntelliJ IDEA (http://www.jetbrains.com).
 
14
RE Johnson, B Foote "Designing reusable classes" Journal of Object-Oriented Programming 1:2 (1988) 22--35.
 
15
 
16
JUnit unit testing framework (http://junit.org).
 
17
H Kegel Constraint-basierte Typinferenz für Java 5 (Diplomarbeit, Fakultät für Mathematik und Informatik, Fernuniversität in Hagen 2007).
 
18
H Kegel, F Steimann "ITcore: A type inference Package for refactoring tools" in: Workshop on Refactoring Tools @ ECOOP (2007).
 
19
20
 
21
 
22
 
23
24
 
25
26
 
27
F Steimann "The Infer Type refactoring and its use for interface-based programming" Journal of Object Technology 6:2 (2007) 67--89.
28
29
30
 
31
F Tip "Refactoring using type constraints" in: Proc. of Static Analysis, 14th International Symposium (2007) 1--17.
32



REVIEW

"Alexandre Bergel : Reviewer"

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 d  more...

Collaborative Colleagues:
Hannes Kegel: colleagues
Friedrich Steimann: colleagues