Context traits: dynamic behaviour adaptation through run-time trait recomposition

  • Authors:
  • Sebastián González;Kim Mens;Marius Colacioiu;Walter Cazzola

  • Affiliations:
  • Université catholique de Louvain, Louvain-la-Neuve, Belgium;Université catholique de Louvain, Louvain-la-Neuve, Belgium;Università degli Studi di Milano, Milan, Italy;Università degli Studi di Milano, Milan, Italy

  • Venue:
  • Proceedings of the 12th annual international conference on Aspect-oriented software development
  • Year:
  • 2013
  • Features on demand

    Proceedings of the Eighth International Workshop on Variability Modelling of Software-Intensive Systems

Quantified Score

Hi-index 0.00

Visualization

Abstract

Context-oriented programming emerged as a new paradigm to support fine-grained dynamic adaptation of software behaviour according to the context of execution. Though existing context-oriented approaches permit the adaptation of individual methods, in practice behavioural adaptations to specific contexts often require the modification of groups of interrelated methods. Furthermore, existing approaches impose a composition semantics that cannot be adjusted on a domain-specific basis. The mechanism of traits seems to provide a more appropriate level of granularity for defining adaptations, and brings along a flexible composition mechanism that can be exploited in a dynamic setting. This paper explores how to achieve context-oriented programming by using traits as units of adaptation, and trait composition as a mechanism to introduce behavioural adaptations at run time. First-class contexts reify relevant aspects of the environment in which the application executes, and they directly influence the trait composition of the objects that make up the application. To resolve conflicts arising from dynamic composition of behavioural adaptations, programmers can explicitly encode composition policies. With all this, the notion of context traits offers a promising approach to implementing dynamically adaptable systems. To validate the context traits model we implemented a JavaScript library and conducted case studies on context-driven adaptability.