Adding State and Visibility Control to Traits Using Lexical Nesting

Free registration required

Executive Summary

Traits are reusable building blocks that can be composed to share methods across unrelated class hierarchies. Original traits are stateless and cannot express visibility control for methods. Two extensions, stateful traits and freezable traits, have been proposed to overcome these limitations. However, these extensions introduce complexity and have not yet been combined to simultaneously add both state and visibility control to traits. This paper revisits the addition of state and visibility control to traits. Rather than extending the original traits model with additional operations, the authors allow traits to be lexically nested within other modules.

  • Format: PDF
  • Size: 270.55 KB