Last updated at 7:51 pm UTC on 17 June 2018
Work done at the Universitat Berne - Institut fur Informatik und angewandte Mathematik, and Andrew Black at OGI School of Science and Enginering, on a simpler, clearer way of providing mixin/multiple-inheritance benefits without their drawbacks.
The research group is called the Software Composition Group. http://scg.unibe.ch
Search in the bibliography for papers on 'Traits'.
Traits are an object-oriented programming language construct that allow groups of methods to be named and reused in arbitrary places in an inheritance hierarchy.
Classes can use methods from traits as well as defining their own methods and instance variables. Traits thus enable a new style of programming, in which traits rather than classes are the primary unit of reuse.
However, the additional sub-structure provided by traits is always optional: a class written using traits can also be viewed as a flat collection of methods, with no change in its semantics. This paper describes the tool that supports these two alternate views of a class, called the traits browser, and the programming methodology that we are starting to develop around the use of traits.
Nathanael Schaerli, PhD thesis http://scg.unibe.ch/archive/phd/schaerli-phd.pdf, 2005
Traits - Composing Classes from Behavioral Building Blocks
Traits is part of Squeak 3.9. -Lex Spoon
Status update, 15-DEC-2005
There is now ready a Squeak 3.9a image with traits included. It may be downloaded from http://www.adrian-lienhard.ch/files/Squeak3.9a-traits.zip. (Description)
There are examples how to make use of traits on SqueakMap.
Status update, 6 Sept, 2005.
There have been discussions on including Traits in 3.9. There have been no real arguments against inclusion of Traits, and many supporters. The intent is now to merge it in as soon as it is ready.
What is missing for Traits to be included?
- Currently Traits can only be loaded into existing Squeak images through a problematic process that overrides various system methods, causing mysterious bugs. Since inclusion in the image these days means loading/merging as an MC package, there is some repackaging work to do. This is being worked on by SCG, Andrew Black and myself (Daniel Vainsencher), and we can't use help at the moment. However:
- In the mean time, there is an image people can start from at: http://www.cs.pdx.edu/~danielv/TraitsBeta3.02.tgz. In this version you are quite welcome to try things out and report bugs in Mantis.
- There will be much more to do once I release another version, I'll update this page then.