Tuesday, December 27, 2011

SCG: Traits - Composable Units of Behavior

SCG: Traits - Composable Units of Behavior: "Traits are a simple composition mechanism for structuring object-oriented programs. A Trait is essentially a parameterized set of methods; it serves as a behavioral building block for classes and is the primitive unit of code reuse. With Traits, classes are still organized in a single inheritance hierarchy, but they can make use of Traits to specify the incremental difference in behavior with respect to their superclasses."

'via Blog this'