Generalized layer activation mechanism through contexts and subscribers

Context-oriented programming (COP) languages modularize context-dependent behaviors in multiple classes into layers. These languages have layer activation mechanisms so that the behaviors in layers take effect on a particular unit of computation during a particular period of time. Existing COP languages have different layer activation mechanisms, and each of them has its own advantages. However, because these mechanisms interfere with each other in terms of extent (time duration) and scope (a set of units of computations) of activation, it is not trivial to combine them into a single language. We propose a generalized layer activation mechanism based on contexts and subscribers to implement the different activation mechanisms in existing COP languages in a single COP language called ServalCJ. Contexts specify the extent of activation through temporal logic terms, and subscribers specify the scope of activation through operators provided by the language. We implement a compiler of ServalCJ, and demonstrate its expressiveness by writing a couple of application programs.

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

[2]  Patrick Th. Eugster,et al.  EventJava: An Extension of Java for Event Correlation , 2009, ECOOP.

[3]  Michael Haupt,et al.  A comparison of context-oriented programming languages , 2009, COP@ECOOP.

[4]  Gary T. Leavens,et al.  Ptolemy: A Language with Quantified, Typed Events , 2008, ECOOP.

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

[6]  Takuo Watanabe,et al.  LEAD++: an object-oriented language based on a reflective model for dynamic software adaptation , 1999, Proceedings Technology of Object-Oriented Languages and Systems (Cat. No.PR00393).

[7]  Martin Odersky,et al.  Scalable component abstractions , 2005, OOPSLA '05.

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

[9]  Hidehiko Masuhara,et al.  Featherweight EventCJ: a core calculus for a context-oriented language with event-based per-instance layer transition , 2011, COP@ECOOP.

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

[11]  Shigeru Chiba,et al.  Method slots: supporting methods, events, and advices by a single language construct , 2013, LNCS Trans. Aspect Oriented Softw. Dev..

[12]  Somayeh Malakuti,et al.  Event Modules - Modularizing Domain-Specific Crosscutting RV Concerns , 2014, LNCS Trans. Aspect Oriented Softw. Dev..

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

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

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

[16]  Hidehiko Masuhara,et al.  A unified context activation mechanism , 2013, COP@ECOOP.

[17]  Kim Mens,et al.  Context traits: dynamic behaviour adaptation through run-time trait recomposition , 2013, AOSD.

[18]  Randall B. Smith,et al.  SELF: The power of simplicity , 1987, OOPSLA '87.

[19]  Somayeh Malakuti,et al.  Evolution of composition filters to event composition , 2012, SAC '12.

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

[21]  Atsushi Igarashi,et al.  ContextFJ: a minimal core calculus for context-oriented programming , 2011, FOAL.

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

[23]  Martin D. Westhead,et al.  A methodology for benchmarking Java Grande applications , 1999, JAVA '99.

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

[25]  Ondrej Lhoták,et al.  abc: an extensible AspectJ compiler , 2005, AOSD '05.

[26]  Oscar Nierstrasz,et al.  Context-oriented Programming , 2008, J. Object Technol..

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

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

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

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

[31]  Takuo Watanabe,et al.  LEAD: a linguistic approach to dynamic adaptability for practical applications , 1998, Systems Implementation 2000.

[32]  Alexandre Bergel,et al.  Context-Aware Aspects , 2006, SC@ETAPS.