Trait (computer programming): Difference between revisions

Content deleted Content added
m
No edit summary
Line 1:
In [[computer programming]], a '''trait''' is ana collection of methods, used as a "simple conceptual model for structuring [[object oriented]] programs".<ref>http://web.cecs.pdx.edu/~black/publications/TR_CSE_02-012.pdf</ref> Traits are similar to [[mixin]]s, but whereas mixins can be composed only using the inheritance operation, traits offer a much wider selection of operations, including symmetric sum, method exclusion, and aliasing. A Trait differs from an [[abstract type]] in that it provides implementations of its methods, not just type signatures.
 
Traits are supported as a native language feature in the [[Fortress programming language]] (where they also play the role of types), in the [[Scala programming language]],