Code Reuse

Recent years saw the development of a composition mechanism called Traits. Traits are pure units of behavior that can be composed to form classes or other traits. The trait composition mechanism is an alternative to multiple or mixin inheritance in which the composer has full control over the trait composition.

Note: We're not so much interested in code reuse as we are in modeling Concepts.

An object is some unknown state ? on which a method M can be invoked by Name. To implement this model we need a mapping from method names to method implementations. So, to invoke a method M′ in the object ?’ we find the corresponding method implementation in a Behaviour Description B′. Hence an object is a tuple of behaviour B′ and state ?’. Since behaviour is separate from the object it describes, it is possible to share any given behaviour B′ between several distinct objects ?’, ?’’, ?’’’, …