A comparison of module constructs in programming languages
ACM SIGPLAN Notices
Eiffel: the language
The revised report on the syntactic theories of sequential control and state
Theoretical Computer Science
The programming language jigsaw: mixins, modularity and multiple inheritance
The programming language jigsaw: mixins, modularity and multiple inheritance
Encapsulation, delegation and inheritance in object-oriented languages
Software Engineering Journal - Object-oriented systems
Object-oriented software construction (2nd ed.)
Object-oriented software construction (2nd ed.)
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
POPL '98 Proceedings of the 25th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Information and Computation - FOOL V
Java Language Specification, Second Edition: The Java Series
Java Language Specification, Second Edition: The Java Series
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
Object-oriented encapsulation for dynamically typed languages
OOPSLA '04 Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
Java(TM) Language Specification, The (3rd Edition) (Java (Addison-Wesley))
Java(TM) Language Specification, The (3rd Edition) (Java (Addison-Wesley))
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
Runtime bytecode transformation for Smalltalk
Computer Languages, Systems and Structures
ECOOP'07 Proceedings of the 21st European conference on Object-Oriented Programming
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
Adding State and Visibility Control to Traits Using Lexical Nesting
Genoa Proceedings of the 23rd European Conference on ECOOP 2009 --- Object-Oriented Programming
Magda: a new language for modularity
ECOOP'12 Proceedings of the 26th European conference on Object-Oriented Programming
Using roles to model crosscutting concerns
Proceedings of the 12th annual international conference on Aspect-oriented software development
Hi-index | 0.00 |
A trait is a unit of behaviour that can be composed with other traits and used by classes. Traits offer an alternative to multiple inheritance. Conflict resolution of traits, while flexible, does not completely handle accidental method name conflicts: if a trait with method m is composed with another trait defining a different method m then resolving the conflict may prove delicate or infeasible in cases where both versions of m are still needed. In this paper we present freezeable traits, which provide an expressive composition mechanism to support unanticipated method composition conflicts. Our solution introduces private trait methods and lets the class composer change method visibility at composition time (from public to private and vice versa). Moreover two class composers may use different composition policies for the same trait, something which is not possible in mainstream languages. This approach respects the two main design principles of traits: the class composer is empowered and traits can be flattened away. We present an implementation of freezable traits in Smalltalk. As a side-effect of this implementation we introduced private (early-bound and invisible) methods to Smalltalk by distinguishing object-sends from self-sends. Our implementation uses compile-time bytecode manipulation and, as such, introduces no run-time penalties.