Adding State and Visibility Control to Traits using Lexical Nesting - Inria - Institut national de recherche en sciences et technologies du numérique Accéder directement au contenu
Communication Dans Un Congrès Année : 2009

Adding State and Visibility Control to Traits using Lexical Nesting

Résumé

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
Origine : Fichiers produits par l'(les) auteur(s)
Loading...

Dates et versions

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

Identifiants

  • HAL Id : inria-00498397 , version 1

Citer

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⟩
109 Consultations
207 Téléchargements

Partager

Gmail Facebook X LinkedIn More