A trait based re-engineering technique for Java hierarchies

  • Authors:
  • Lorenzo Bettini;Viviana Bono;Marco Naddeo

  • Affiliations:
  • Università di Torino;Università di Torino;Università di Torino

  • Venue:
  • Proceedings of the 6th international symposium on Principles and practice of programming in Java
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

Traits are pure behavior components introduced in the Smalltalk community in order to integrate the traditional class inheritance with a composition mechanism: a class is composed by traits and inherits from superclasses. This offers the advantage of promoting code reuse. In this paper, we tackle the problem of re-engineering a Java hierarchy into traits, by adapting to a Java setting a methodology developed by Lienhard, Ducasse, and Arévalo for a Smalltalk setting, based on Formal Concept Analysis. We illustrate the approach by applying it to the Java input stream library. We also obtain two by-products: (i) we identify clearly some workarounds that programmers must exploit in order to overcome some of the limitations of Java single inheritance; (ii) we single out some features a Java with traits might include, as none of the proposals in the literature in this sense has taken the lead yet.