Push-based reactive layer activation in context-oriented programming

There are context-dependent behaviors that are active only when a certain condition holds, and that require a certain transition process before activation. We propose a layer-activation mechanism of context-oriented programming languages for such context-dependent behaviors. Our mechanism supports the implicit layer activation (as opposed to the event-based layer activation) in a sense that a condition of activation is written as a conditional expression over reactive values (e.g., values obtained from sensors). In addition, it is push-based in a sense that it executes the transition process immediately after the condition becomes valid (as opposed to the mechanisms that defer the transition process until the first execution of a context-dependent behavior). In this paper, we present how this mechanism works in an extension of ServalCJ with push-based reactive values, and identify open issues raised by this proposal.

[1]  Gergely Patai,et al.  Efficient and Compositional Higher-Order Streams , 2010, WFLP.

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

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

[4]  Tetsuo Kamina,et al.  Detecting Invalid Layer Combinations Using Control-Flow Analysis for Android , 2016, COP@ECOOP.

[5]  Atsushi Igarashi,et al.  A library-based approach to context-dependent computation with reactive values: suppressing reactions of context-dependent functions using dynamic binding , 2016, MODULARITY.

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

[7]  Tetsuo Kamina Introducing lightweight reactive values to Java , 2016, SPLASH.

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

[9]  Hidehiko Masuhara,et al.  Generalized Layer Activation Mechanism for Context-Oriented Programming , 2016, LNCS Trans. Modul. Compos..

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

[11]  Conal Elliott,et al.  Push-pull functional reactive programming , 2009, Haskell.

[12]  Andrej Bauer,et al.  Programming with algebraic effects and handlers , 2012, J. Log. Algebraic Methods Program..

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

[14]  Cormac Flanagan,et al.  Reactive programming with reactive variables , 2016, MODULARITY.

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

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

[17]  Mira Mezini,et al.  REScala: bridging between object-oriented and functional style in reactive applications , 2014, MODULARITY.

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