| |
||
Traits Composable Units of BehaviorWe have been developing a simple compositional model for structuring object-oriented programs, which we call traits. Traits are essentially groups of methods that serve as building blocks for classes and are primitive units of code reuse. In this model, classes are composed from a set of traits by specifying glue code that connects the traits together and accesses the necessary state. Unlike mixins and multiple inheritance, traits do not employ the inheritance as the composition operator. Instead, traits composition is based on set of composition operators that are complementary to inheritance and result in better composition properties. We have implemented traits in Squeak, an open-source Smalltalk-80 dialect. PapersThe following papers give an overview of traits and show its practical usability. The first paper in the list, "Traits Composable Units of Behavior", is the concept paper introducing the Traits model and we recommend to read it first.
ImplementationsSqueakA prototype version of traits in Squeak is available for download. See the traits prototype page for more information. In addition, we are preparing a Squeak changeset that allows to file in a more stable version of traits into the latest Squeak image. Visual WorksThe developers of VisualWorks Smalltalk are very interested in incorporating traits into VisualWorks. They plan to build a working traits prototype that should be available somtime in 2003. |
||
|
Last modified: 2003-08-19
|