Adding State and Visibility Control to Traits using Lexical Nesting - Archive ouverte HAL Access content directly
Conference Papers Year : 2009

Adding State and Visibility Control to Traits using Lexical Nesting

(1) , (2) , (2) , (1)
1
2

Abstract

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, we allow traits to be lexically nested within other modules. Traits can then have (shared) state and visibility control by hiding variables or methods in their lexical scope. Although the Traits' “flattening property” has to be revisited, the combination of traits with lexical nesting results in a simple and expressive trait model. We discuss an implementation of the model in AmbientTalk and specify its operational semantics.
Fichier principal
Vignette du fichier
Cuts09a-ECOOP09-Traits.pdf (219.41 Ko) Télécharger le fichier
Origin : Files produced by the author(s)
Loading...

Dates and versions

inria-00498397 , version 1 (07-07-2010)

Identifiers

  • HAL Id : inria-00498397 , version 1

Cite

Tom van Cutsem, Alexandre Bergel, Stéphane Ducasse, Wolfgang de Meuter. Adding State and Visibility Control to Traits using Lexical Nesting. ECOOP, Jul 2009, Genova, Italy. ⟨inria-00498397⟩
105 View
194 Download

Share

Gmail Facebook Twitter LinkedIn More