出典:Wikipedia
出典:『Wikipedia』 (2011/07/01 13:29 UTC 版)
In computer programming, a trait is a collection of methods, used as a "simple conceptual model for structuring object oriented programs". Traits are similar to mixins, 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.