Traits
Sté́phane Ducasse, Oscar Nierstrasz, Nathanael Schärli A et al. · ACM Transactions on Programming Languages and Systems · 2006
Inheritance is well-known and accepted as a mechanism for reuse in object-oriented languages. Unfortunately, due to the coarse granularity of inheritance, it may be difficult to decompose an application into an optimal class hierarchy that maximizes software reuse. Existing schemes based on single inheritance, multiple inheritance, or mixins, all pose numerous problems for reuse. To overcome these problems we propose traits , pure units of reuse consisting only of methods. We develop a formal model of traits that establishes how traits can be composed, either to form other traits, or to form classes. We also outline an experimental validation in which we apply traits to refactor a nontrivial application into composable units.
Cited by 278 works. doi:10.1145/1119479.1119483 Open-access PDF
Authors
References
- Smalltalk-80: The Language and its Implementation
- The C++ Programming Language
- Object-Oriented Software Construction
- Aspect-oriented programming
- An Overview of KRL, a Knowledge Representation Language
- Common LISP. The language
- The Smalltalk-76 programming system design and implementation
- Object-oriented software construction
- Aspect-Oriented Programming
- The Programming Language Aspects of ThingLab, a Constraint-Oriented Simulation Laboratory