Towards safe and flexible object adaptation

Tetsuo Kamina, Tetsuo Tamai
2009 International Workshop on Context-Oriented Programming - COP '09  
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
more » ... d that an object is always bound with the role activated so that no method-notunderstood 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.
doi:10.1145/1562112.1562116 dblp:conf/ecoop/KaminaT09 fatcat:pvdrobobordhpctqp4t53lzfxe