Encapsulation and inheritance in object-oriented programming languages
OOPLSA '86 Conference proceedings on Object-oriented programming systems, languages and applications
OOPSLA '87 Conference proceedings on Object-oriented programming systems, languages and applications
The annotated C++ reference manual
The annotated C++ reference manual
OOPSLA/ECOOP '90 Proceedings of the European conference on object-oriented programming on Object-oriented programming systems, languages, and applications
Organizing programs without classes
Lisp and Symbolic Computation
Eiffel: the language
ACM SIGPLAN Notices
The programming language jigsaw: mixins, modularity and multiple inheritance
The programming language jigsaw: mixins, modularity and multiple inheritance
Back to the future: the story of Squeak, a practical Smalltalk written in itself
Proceedings of the 12th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
Space and time-efficient memory layout for multiple inheritance
Proceedings of the 14th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
Interfaces with default implementations in Java
PPPJ '02/IRE '02 Proceedings of the inaugural conference on the Principles and Practice of programming, 2002 and Proceedings of the second workshop on Intermediate representation engineering for virtual machines, 2002
Object-Oriented Multi-Methods in Cecil
ECOOP '92 Proceedings of the European Conference on Object-Oriented Programming
Applying traits to the smalltalk collection classes
OOPSLA '03 Proceedings of the 18th annual ACM SIGPLAN conference on Object-oriented programing, systems, languages, and applications
Traits: A mechanism for fine-grained reuse
ACM Transactions on Programming Languages and Systems (TOPLAS)
Stateful traits and their formalization
Computer Languages, Systems and Structures
Redesigning with traits: the Nile stream trait-based library
ICDL '07 Proceedings of the 2007 international conference on Dynamic languages: in conjunction with the 15th International Smalltalk Joint Conference 2007
Traits at work: The design of a new trait-based stream library
Computer Languages, Systems and Structures
SC '09 Proceedings of the 8th International Conference on Software Composition
I-Java: An Extension of Java with Incomplete Objects and Object Composition
SC '09 Proceedings of the 8th International Conference on Software Composition
Featherweight Jigsaw: A Minimal Core Calculus for Modular Composition of Classes
Genoa Proceedings of the 23rd European Conference on ECOOP 2009 --- Object-Oriented Programming
Featherweight Jigsaw - Replacing inheritance by composition in Java-like languages
Information and Computation
Hi-index | 0.00 |
Traits offer a fine-grained mechanism to compose classes from reusable components while avoiding problems of fragility brought by multiple inheritance and mixins. Traits as originally proposed are stateless, that is, they contain only methods, but no instance variables. State can only be accessed within traits by accessors, which become required methods of the trait. Although this approach works reasonably well in practice, it means that many traits, viewed as software components, are artificially incomplete, and classes that use such traits may contain significant amounts of boilerplate glue code. Although these limitations are largely mitigated by proper tool support, we seek a cleaner solution that supports stateful traits. The key difficulty is how to handle conflicts that arise when composed traits contribute instance variables whose names clash. We present a solution that is faithful to the guiding principle of stateless traits: the client retains control of the composition. Stateful traits consist of a minimal extension to stateless traits in which instance variables are purely local to the scope of a trait, unless they are explicitly made accessible by the composing client of a trait. Naming conflicts are avoided, and variables of disjoint traits can be explicitly merged by clients. We discuss and compare two implementation strategies, and briefly present a case study in which stateful traits have been used to refactor the trait-based version of the Smalltalk collection hierarchy.