Implementation of a Feature-Based Context-Oriented Programming Language

We implemented a feature-based context-oriented programming language, which clearly separates the notion of contexts from the notion of features. Contexts reify particular situations occurring in the surrounding environment, to which a software system can adapt. Features reify the system's behaviour; they are the language components that describe the system's functionality at a fine-grained level. Contexts are mapped to features, such that, when certain contexts become active at run-time, the corresponding features get selected and activated, thus adapting the system's functionality to those particular contexts. In this paper we show the object-oriented architecture, design and implementation issues of such a feature-based context-oriented programming language, which we implemented on top of the Ruby programming language as an application framework for context-oriented programmers. An important part of our language design is the explicit representation of contexts and features in terms of hierarchical tree structures that capture the structural constraints to be maintained at runtime. We illustrate our language design with a small example of a feature-based context-oriented program written in this language.

[1]  Margaret M. Burnett,et al.  A practical guide to controlled experiments of software engineering tools with human participants , 2013, Empirical Software Engineering.

[2]  Kim Mens,et al.  Modeling and Analyzing Self-Adaptive Systems with Context Petri Nets , 2013, 2013 International Symposium on Theoretical Aspects of Software Engineering.

[3]  Matteo Pradella,et al.  Context-oriented programming: A software engineering perspective , 2012, J. Syst. Softw..

[4]  Kim Mens,et al.  Dynamic visualisation of features and contexts for context-oriented programmers , 2019, EICS.

[5]  Gregory D. Abowd,et al.  Towards a Better Understanding of Context and Context-Awareness , 1999, HUC.

[6]  M. Appeltauer,et al.  Dedicated Programming Support for Context-Aware Ubiquitous Applications , 2008, 2008 The Second International Conference on Mobile Ubiquitous Computing, Systems, Services and Technologies.

[7]  Rafael Capilla,et al.  Context Variability for Context-Aware Systems , 2014, Computer.

[8]  Rafael Capilla,et al.  Collaborative Context Features for Critical Systems , 2015, VaMoS.

[9]  Xiaodong Liu,et al.  Mapping Features to Context Information: Supporting Context Variability for Context-Aware Pervasive Applications , 2010, 2010 IEEE/WIC/ACM International Conference on Web Intelligence and Intelligent Agent Technology.

[10]  Michael Haupt,et al.  An Introduction to Context-Oriented Programming with ContextS , 2007, GTTSE.

[11]  João Saraiva,et al.  Generative and Transformational Techniques in Software Engineering II , 2007, Lecture Notes in Computer Science.

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

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

[14]  Kim Mens,et al.  Modeling and Managing Context-Aware Systems' Variability , 2017, IEEE Softw..

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

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

[17]  Tim Trew,et al.  Using Feature Diagrams with Context Variability to Model Multiple Product Lines for Software Supply Chains , 2008, 2008 12th International Software Product Line Conference.

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

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

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

[21]  Kim Mens,et al.  Feature Visualiser: an Inspection Tool for Context-Oriented Programmers , 2018, COP@ECOOP.

[22]  Kyo Chul Kang,et al.  Feature-Oriented Domain Analysis (FODA) Feasibility Study , 1990 .

[23]  Kim Mens,et al.  A Context-Oriented Software Architecture , 2016, COP@ECOOP.

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

[25]  Matteo Pradella,et al.  JavaCtx: seamless toolchain integration for context-oriented programming , 2011, COP@ECOOP.

[26]  Matteo Pradella,et al.  Programming language support to context-aware adaptation: a case-study with Erlang , 2010, SEAMS '10.

[27]  Kim Mens,et al.  Managing the Context Interaction Problem: A Classification and Design Space of Conflict Resolution Techniques in Dynamically Adaptive Software Systems , 2017, Programming.