Adding state and visibility control to traits using lexical nesting

8Citations
Citations of this article
21Readers
Mendeley users who have this article in their library.
Get full text

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. © 2009 Springer Berlin Heidelberg.

Cite

CITATION STYLE

APA

Van Cutsem, T., Bergel, A., Ducasse, S., & De Meuter, W. (2009). Adding state and visibility control to traits using lexical nesting. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) (Vol. 5653 LNCS, pp. 220–243). https://doi.org/10.1007/978-3-642-03013-0_11

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free