case sensitive

Sort by: Display: Hide controls:

  1. Nathanael Schärli, Oscar Nierstrasz, Stéphane Ducasse, Roel Wuyts, and Andrew Black. Traits: The Formal Model. Technical Report IAM-02-006, Institut für Informatik, Universität Bern, Switzerland, 2002. Also available as Technical Report CSE-02-013, OGI School of Science & Engineering, Beaverton, Oregon, USA. 

    Single-inheritance in object-oriented languages can lead to duplicated code in rich class libraries where feature-sharing cannot be linearized. Multiple-inheritance and mixins alleviate this problem, but lead to other difficulties in the face of evolution. Changes to classes or mixins can break code lower in the hierarchy in unexpected ways. Traits solve both problems by factoring out shared behaviour as sets of methods that do not depend on state. Traits have the important property that composition is symmetric, so changes do not lead to unexpected side effects. We present a formal model of traits, and define some basic properties of traits and classes.