Trait (computer programming): Difference between revisions

Content deleted Content added
Zyx (talk | contribs)
m +pl
Corrected definition of Trait, and added reference to Fortress
Line 1:
In [[computer programming]], a '''trait''' is an [[abstractcollection type]]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 maywhereas includemixins definitionscan forbe classcomposed only using the inheritance operation, traits offer a much wider selection of operations, including symmetric sum, method exclusion, and aliasing. A Trait differs from a [[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]],
<ref>http://www.scala-lang.org/node/126 A Tour of Scala: Traits</ref>
<ref>http://www.ibm.com/developerworks/java/library/j-scala04298.html The busy Java developer's guide to Scala: Of traits and behaviors</ref>