|
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.
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
|
The Fortress language specification. http://research.sun.com/projects/plrg/fortress.pdf.
|
| |
2
|
|
| |
3
|
A. Black, S. Ducasse, O. Nierstrasz, D. Pollet, D. Cassou, and M. Denker. Squeak by Example. Square Bracket Associates, 2007.
|
| |
4
|
|
 |
5
|
|
| |
6
|
V. Bono, F. Damiani, and E. Giachino. Separating Type, Behavior, and State to Achieve Very Fine-grained Reuse. In Electronic proceedings of FTfJP '07 (http://www.cs.ru.nl/ftfjp/), 2007.
|
| |
7
|
V. Bono, F. Damiani, and E. Giachino. On traits and types in a Java-like setting. In IFIP TCS 2008 (Track B). Springer, 2008. Availble at the url http://www.di.unito.it/~damiani/papers/tcs08B.pdf.
|
| |
8
|
|
 |
9
|
|
| |
10
|
G. Bracha and D. Griswold. Extending Smalltalk with mixins. In OOPSLA96 Workshop on Extending the Smalltalk Language, 1996. http://www.javasoft.com/people/gbracha/mwp.html.
|
 |
11
|
|
 |
12
|
|
| |
13
|
S. Ducasse, N. Schärli, and R. Wuyts. Uniform and safe metaclass composition. Computer Languages, Systems and Structures, 31(3--4):143--164, 2005.
|
| |
14
|
K. Fisher and J. Reppy. Statically typed traits. Technical Report TR-2003-13, University of Chicago, Department of Computer Science, Dec. 2003.
|
| |
15
|
K. Fisher and J. Reppy. A typed calculus of traits. In Electronic proceedings of FOOL 2004, 2004.
|
 |
16
|
Matthew Flatt , Shriram Krishnamurthi , Matthias Felleisen, Classes and mixins, Proceedings of the 25th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.171-183, January 19-21, 1998, San Diego, California, United States
[doi> 10.1145/268946.268961]
|
| |
17
|
|
 |
18
|
Dan Ingalls , Ted Kaehler , John Maloney , Scott Wallace , Alan Kay, Back to the future: the story of Squeak, a practical Smalltalk written in itself, Proceedings of the 12th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, p.318-326, October 05-09, 1997, Atlanta, Georgia, United States
|
 |
19
|
|
| |
20
|
C. Lindig. Fast Concept Analysis. PhD thesis, Harvard University, Division of Engineering and Applied Sciences, Cambridge, Massachusetts, 2002.
|
 |
21
|
|
| |
22
|
|
| |
23
|
M. Naddeo. Un possibile approccio alla soluzione di alcuni problemi legati all'ereditarietà singola nei linguaggi object-oriented. Laurea triennale in informatica, Università degli Studi di Torino, 2008.
|
| |
24
|
O. Nierstrasz, S. Ducasse, and N. Schärli. Flattening traits. JOT (www.jot.fm), 5(4):129--148, 2006.
|
| |
25
|
M. Odersky. The Scala Language Specification, version 2.4. Technical report, Programming Methods Laboratory, EPFL, Switzerland, 2007.
|
 |
26
|
Philip J. Quitslund , Emerson R. Murphy-Hill , Andrew P. Black, Supporting Java traits in Eclipse, Proceedings of the 2004 OOPSLA workshop on eclipse technology eXchange, p.37-41, October 24-24, 2004, Vancouver, British Columbia, Canada
[doi> 10.1145/1066129.1066137]
|
| |
27
|
J. Reppy and A. Turon. A foundation for trait-based metaprogramming. In Electronic proceedings of FOOL/WOOD 2006, 2006.
|
| |
28
|
J. Reppy and A. Turon. Metaprogramming with traits. In ECOOP 2007, volume 4609 of LNCS, pages 373--398. Springer, 2007.
|
| |
29
|
N. Schärli, S. Ducasse, O. Nierstrasz, and A. Black. Traits: Composable units of behavior. In ECOOP 2003, volume 2743 of LNCS, pages 248--274. Springer, 2003.
|
| |
30
|
|
| |
31
|
C. Smith and S. Drossopoulou. Chai: Traits for Java-like languages. In ECOOP '05, LNCS 3586, pages 453--478. Springer, 2005.
|
| |
32
|
|
|