Method Safety Mechanism for Asynchronous Layer Deactivation

We propose a context-oriented programming (COP) language that allows layers to define base methods, while layers can be asynchronously activated and deactivated. Base methods in layers greatly enhances modularity because they extend classes' interface without modifying the original class definitions. However, calling such a method defined in a layer is tricky as the layer may not be active when the method is called. We tackle this problem by introducing a method lookup mechanism that uses the lexical scope of a method invocation to COP; i.e., besides currently activated layers, the layer where the method invocation is written, as well as layers on which that layer depends, are considered for method lookup. We implemented this mechanism in ServalCJ, a COP language that supports asynchronous layer activation as well as synchronous layer activation.

[1]  Andry Rakotonirainy,et al.  Context-oriented programming , 2003, MobiDe '03.

[2]  Hidehiko Masuhara,et al.  Improving the development of context-dependent Java applications with ContextJ , 2009, COP@ECOOP.

[3]  Matteo Pradella,et al.  ContextErlang: introducing context-oriented programming in the actor model , 2012, AOSD '12.

[4]  Harold Ossher,et al.  Korz: Simple, Symmetric, Subjective, Context-Oriented Programming , 2014, Onward!.

[5]  Robert Hirschfeld,et al.  Language constructs for context-oriented programming: an overview of ContextL , 2005, DLS '05.

[6]  Hidehiko Masuhara,et al.  A core calculus of composite layers , 2013, FOAL.

[7]  Coen De Roover,et al.  Interruptible context-dependent executions: a fresh look at programming context-aware applications , 2012, Onward! 2012.

[8]  P ? ? ? ? ? ? ? % ? ? ? ? , 1991 .

[9]  Robert Hirschfeld,et al.  An open implementation for context-oriented layer composition in ContextJS , 2011, Sci. Comput. Program..

[10]  Michael Haupt,et al.  ContextJ: Context-oriented Programming with Java , 2011 .

[11]  Atsushi Igarashi,et al.  A Type System for Dynamic Layer Composition , 2012 .

[12]  Kim Mens,et al.  Subjective-C - Bringing Context to Mobile Platform Programming , 2010, SLE.

[13]  Theo D'Hondt,et al.  Feature Descriptions for Context-oriented Programming , 2008, SPLC.

[14]  Dirk Riehle,et al.  The Role Object Pattern , 1997 .

[15]  Pascal Costanza Context-oriented programming in ContextL: state of the art , 2008, LISP50.

[16]  Atsushi Igarashi,et al.  On-Demand Layer Activation for Type-Safe Deactivation , 2014, COP'14.

[17]  Atsushi Igarashi,et al.  Towards Type-Safe JCop: A type system for layer inheritance and first-class layers , 2014, COP'14.

[18]  Oscar Nierstrasz,et al.  Context-oriented programming: beyond layers , 2007, ICDL '07.

[19]  Yaron Kashai,et al.  Modules as Objects in Newspeak , 2010, ECOOP.

[20]  Hidehiko Masuhara,et al.  Introducing Composite Layers in EventCJ , 2013 .

[21]  Atsushi Igarashi,et al.  A Sound Type System for Layer Subtyping and Dynamically Activated First-Class Layers , 2015, APLAS.

[22]  Hidehiko Masuhara,et al.  EventCJ: a context-oriented programming language with declarative event-based context transition , 2011, AOSD '11.

[23]  Robert Hirschfeld,et al.  Implementing scoped method tracing with ContextJS , 2011, COP@ECOOP.

[24]  Michael Haupt,et al.  Event-Specific Software Composition in Context-Oriented Programming , 2010, SC@TOOLS.

[25]  Tetsuo Tamai,et al.  McJava - A Design and Implementation of Java with Mixin-Types , 2004, APLAS.

[26]  Hidehiko Masuhara,et al.  Generalized layer activation mechanism through contexts and subscribers , 2015, MODULARITY.

[27]  Kim Mens,et al.  Context-Oriented Programming with the Ambient Object System , 2008, J. Univers. Comput. Sci..

[28]  William G. Griswold,et al.  An Overview of AspectJ , 2001, ECOOP.

[29]  Philip Wadler,et al.  Featherweight Java: a minimal core calculus for Java and GJ , 2001, TOPL.

[30]  Robert Hirschfeld,et al.  Layered design approach for context-aware systems , 2007, VaMoS.