Jump to content

Trait (computer programming): Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m Quick-adding category Programming language topics (using HotCat)
Zyx (talk | contribs)
m +pl
Line 25: Line 25:
[[es:Trait]]
[[es:Trait]]
[[fr:Trait (type abstrait)]]
[[fr:Trait (type abstrait)]]
[[pl:Cecha (programowanie obiektowe)]]
[[ru:Типаж (абстрактный тип)]]
[[ru:Типаж (абстрактный тип)]]

Revision as of 08:45, 4 January 2010

In computer programming, a trait is an abstract type, used as a "simple conceptual model for structuring object oriented programs".[1] Traits are similar to mixins, but may include definitions for class methods.

Traits are supported as a native language feature in the Scala programming language, [2] [3] the Squeak version of Smalltalk from version 3.9, and in Perl 6 (which calls them "roles"), as an add-on by the Moose module for Perl 5 and the Joose framework for JavaScript, and have been proposed for inclusion in PHP and ActionScript 3.0. Module mixins in Ruby are similar to traits to some degree.

Traits were initially developed at the Software Composition Group, University of Berne.[4]

External links

References