Towards safe and flexible object adaptation

  • Authors:
  • Tetsuo Kamina;Tetsuo Tamai

  • Affiliations:
  • The University of Tokyo, Hongo Bunkyo-ku Tokyo, Japan;The University of Tokyo, Komaba Meguro-ku Tokyo, Japan

  • Venue:
  • International Workshop on Context-Oriented Programming
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

In this paper, a programming language NextEJ is proposed. NextEJ is based on Epsilon model, which realizes object adaptation to contexts. The novelty of Epsilon model is its ability to make objects be able to freely enter or leave contexts dynamically and belong to multiple contexts at a time. However, such kind of flexibility also easily brings type-unsafety. NextEJ tackles this problem by introducing a new feature called context activation scope. Inside a context activation scope, it is assured that an object is always bound with the role activated so that no method-not-understood errors occur at run-time. Furthermore, context activation scope can be nested so that multiple contexts can be activated at a time. A role instance has a pre-defined field thisContext which refers to its enclosing context instance. In the case of multiple context activations, the reference of thisContext is interpreted as a composite context whose behavior is determined by the order of activations.