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**. It enables more reuse than single inheritance without introducing the drawbacks of multiple or mixin inheritance. page

~

"Maybe **Traits** can be used here to represent multiple concepts." – serge.st via discord

here ⇒ HemalVarambhia — 2022-04-24 Mathematical fields - set over which + and × are defined > In summary, the Complex Numbers form a rich structure that is simultaneously an algebraically closed field, a commutative algebra over the reals, and a Euclidean vector space of dimension two. discord

~

We think **Traits** can do the job of Interfaces (or similar concept with different name) in other languages, it just seems that in Smalltalk there is decades of inertia in stylistically using sub-classing as the only hammer for the job, a large majority of the time. Maybe 'dog-food' some software-assessment/moldable development architectural checks/constraints at feenk to slowly but steadily increase the use of well defined Traits, specially in parts of Gt that users would modify (which sounds like potentially everywhere. We are not using terms like 'always' or 'never' or 'none', as we know parts of Gt do use Traits, but second that more would be very useful for users.

~

The Pharo as one particular Smalltalk implementation slightly changed the language metamodel in version 7 by an introduction of Stateful Traits. It was not possible to cover it with the FAMIX meta-model.