Runtime support for type-safe and context-based behavior adaptation

  • Authors:
  • Changpeng Zhu;Yinliang Zhao;Bo Han;Qinghua Zeng;Ying Ma

  • Affiliations:
  • Department of Computer Science, Xi'an Jiaotong University, Xi'an, China 710049;Department of Computer Science, Xi'an Jiaotong University, Xi'an, China 710049;Department of Computer Science, Xi'an Jiaotong University, Xi'an, China 710049;Department of Computer Science, Xi'an Jiaotong University, Xi'an, China 710049;Department of Computer Science, Xi'an Jiaotong University, Xi'an, China 710049

  • Venue:
  • Frontiers of Computer Science: Selected Publications from Chinese Universities
  • Year:
  • 2014

Quantified Score

Hi-index 0.00

Visualization

Abstract

Context-awareness is becoming critical for mobile and ubiquitous computing, where the application needs dynamically adapt its behavior to its execution environment. Context-oriented programming (COP) languages support dynamic behavior adaptation, however, they do not support dynamic layer addition. As a result, they provide little support for the runtime adaptation of application behavior in case that unpredictable execution environments are encountered. Furthermore, block-structured constructs for layer activation hardly support fine-grain adaptation and separate changes of contexts and execution of context-specific methods with difficulty. In this paper, we propose a virtual machine (VM)-centric approach to address these issues. It incorporates object composition and delegation into the VM to implement layer activation, and extends existing VM services to support dynamic layer addition. To ensure that our approach preserves the type safety properties of the program, we develop a calculus built on featherweight Java (FJ) to describe the approach, focus on type-checking issues, and prove type soundness of the calculus. We also present the implementation and evaluation of our approach. The evaluation demonstrates that our approach has advantages over the compilerbased approach proposed by JCOP.