Efficient layer activation for switching context-dependent behavior

  • Authors:
  • Pascal Costanza;Robert Hirschfeld;Wolfgang De Meuter

  • Affiliations:
  • Programming Technology Lab, Vrije Universiteit Brussel, Brussels, Belgium;Hasso-Plattner-Institut, Universität Potsdam, Potsdam, Germany;Programming Technology Lab, Vrije Universiteit Brussel, Brussels, Belgium

  • Venue:
  • JMLC'06 Proceedings of the 7th joint conference on Modular Programming Languages
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

Today’s programming platforms do not provide sufficient constructs that allow a program’s behavior to depend on the context in which it is executing. This paper presents the design and implementation of programming language extensions that explicitly support our vision of Context-oriented Programming. In this model, programs can be partitioned into layers that can be dynamically activated and deactivated depending on their execution context. Layers are sets of partial program definitions that can be composed in any order. Context-oriented Programming encourages rich, dynamic modifications of program behavior at runtime, requiring an efficient implementation. We present a dynamic representation of layers that yields competitive performance characteristics for both layer activation/deactivation and overall program execution. We illustrate the performance of our implementation by providing an alternative solution for one of the prominent examples of aspect-oriented programming.