TR-2003-13

Statically typed traits

Kathleen Fisher; John Reppy. 12 December, 2003.
Communicated by John Reppy.

Abstract

Traits are mechanism, recently proposed by Scharli et al, for factoring Smalltalk class hierarchies. By separating the issue of code reuse from the inheritance hierarchy, traits allow one to avoid problems with methods defined too high in the inheritance hierarchy while sharing common implementation. Early experience with traits in Smalltalk shows that traits are an effective way to improve code sharing in class hierarchies. This positive experience with traits in the untyped Smalltalk world suggests that traits may be useful in statically typed languages too. In this paper, we present a statically typed calculus of traits, classes, and objects, which can serve as the foundation for extending statically-typed class-based languages, such as Java, with traits.

Original Document

The original document is available in PDF (uploaded 12 December, 2003 by John Reppy).