Lambda the Ultimate

inactiveTopic Traits Composable Units of Behavior
started 12/19/2002; 3:41:47 PM - last post 12/21/2002; 11:43:01 PM
Isaac Gouy - Traits Composable Units of Behavior  blueArrow
12/19/2002; 3:41:47 PM (reads: 335, responses: 1)
Traits Composable Units of Behavior

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

water - Re: Traits Composable Units of Behavior  blueArrow
12/21/2002; 11:43:01 PM (reads: 314, responses: 0)

I met with Nathaniel at this year's OOPSLA conference. He's very enthusiastic about its benefits. He's been working to integrate support for this organization of the libraries into Squeak Smalltalk as a demonstration.

Essentially, the main benefit is that it is effectively optional for the programmer to be aware that the Traits are used to organize the code instead of just classes. Also, dependency information is tracked. There'll be a Squeak image released in the next month that shows this and all the core libraries re-organized on this principle.

I'm also interested in acheiving the same kind of behavior for the Traits of my Smalltalk derivative, Slate.