skip to main content
10.1145/1930021.1930023acmotherconferencesArticle/Chapter ViewAbstractPublication PagesecoopConference Proceedingsconference-collections
research-article

Designing event-based context transition in context-oriented programming

Published: 22 June 2010 Publication History

Abstract

This paper proposes a new programming language EventCJ. Its design stems from our observation that, in many context-aware applications, context changes are triggered by external events. Thus, in addition to the current COP language mechanisms, namely the one to activate/deactivate layers in accordance with a flow of control in programs, and the one to dispatch method calls to partial methods on active layers, we propose a mechanism to declaratively switch contexts of the receiver of events. EventCJ can declare events that trigger context transitions, and context transition rules that define how each instance's context changes when it receives a specific event. After the transition, the instance acquires the context dependent behaviors provided by the activated context. Each event is declared in an AspectJ-like pointcut that specifies where the event is fired in the join points of the system. EventCJ separates the specification of when each context is activated and deactivated that may crosscut whole program in the existing COP languages. Furthermore, the declarative nature of the context transition rules help validation of some properties that the contexts should satisfy.

References

[1]
Chris Allan, Pavel Avgustinov, Aske Simon Christensen, Laurie Hendren, Sascha Kuzins, Ond&rcirc;ej Lhotäk, Oege de Moor, Damien Sereni, Ganesh Sittampalam, and Julian Tibble. Adding trace matching with free variables to AspectJ. In Proceedings of OOPSLA'05, pages 345--364, 2005.
[2]
Malte Appeltauer, Robert Hirschfeld, Michael Haupt, and Hidehiko Masuhara. ContextJ: Context-oriented programming with Java. In Proceedings of the JSSST Annual Conference 2009, 2009.
[3]
Malte Appeltauer, Robert Hirschfeld, and Hidehiko Masuhara. Improving the development of context-dependent Java application with ContextJ. In COP'09, 2009.
[4]
Malte Appeltauer, Robert Hirschfeld, Hidehiko Masuhara, Michael Haupt, and Kazunori Kawauchi. Event-specific software composition in context-oriented programming. In Proceedings of the International Conference on Software Composition 2010 (SC'10), 2010. to appear.
[5]
Ivia Aracic, Vaidas Gasiunas, Mira Mezini, and Klaus Ostermann. An overview of CaesarJ. In Transactions on Aspect-Oriented Software Development I, volume 3880 of LNCS, pages 135--173, 2006.
[6]
Pascal Costanza and Robert Hirschfeld. Language constructs for context-oriented programming --- an overview of ContextL. In Dynamic Language Symposium (DLS) '05, pages 1--10, 2005.
[7]
Patrick Eugster and K. R. Jayaran. EventJava: An extension of Java for event correlation. In ECOOP'09, volume 5653 of LNCS, pages 570--594, 2009.
[8]
Robert Hirschfeld, Pascal Costanza, and Michael Haupt. An introduction to context-oriented programming with ContextS. In GTTSE 2007, volume 5235 of LNCS, pages 396--407, 2008.
[9]
Robert Hirschfeld, Pascal Costanza, and Oscar Nierstrasz. Context-oriented programming. Journal of Object Technology, 7(3):125--151, 2008.
[10]
K. R. Jayaran and Patrick Eugster. Context-oriented programming with EventJava. In COP'09, 2009.
[11]
Tetsuo Kamina and Tetsuo Tamai. Towards safe and flexible object adaptation. In COP'09, 2009.
[12]
G. Kiczales, J. Lamping, A. Mendhekar, C. Maeda, C. Lopes, J.-M. Loingtier, and J. Irwin. Aspect-oriented programming. In ECOOP'97, 1997.
[13]
Gregor Kiczales, Erik Hilsdale, Jim Hugunin, M ik Kersten, Jeffrey Palm, and William G. Grisword. An overview of AspectJ. In ECOOP 2001, pages 327--353, 2001.
[14]
Angel Nú nez, Jacques Noyé, and Vaidas Gasiūnas. Declarative definition of contexts with polymorphic events. In COP'09, 2009.
[15]
Tobias Rho, Günter Kniesel, and Malte Appeltauer. Fine-grained generic aspects. In FOAL'06, 2006.
[16]
Tobias Rho, Mark Schmatz, and Armin B. Cremers. Towards context-sensitive service aspects. In Proceedings of the Workshop on Object Technology for Ambient Intelligence and Pervasive Computing, collocated with ECOOP'06, 2006.
[17]
Robert J. Walker and Kevin Viggers. Implementing protocols via declarative event patterns. In Proceedings of FSE'04, pages 159--169, 2004.

Cited By

View all
  • (2018)Context-Oriented Algorithmic DesignProceedings of the 11th European Lisp Symposium on European Lisp Symposium10.5555/3323215.3323228(84-91)Online publication date: 18-Apr-2018
  • (2017)A Survey of Naturalistic Programming TechnologiesACM Computing Surveys10.1145/310948150:5(1-35)Online publication date: 26-Sep-2017
  • (2013)An Analysis of Language-Level Support for Self-Adaptive SoftwareACM Transactions on Autonomous and Adaptive Systems10.1145/2491465.24914668:2(1-29)Online publication date: 1-Jul-2013
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
COP '10: Proceedings of the 2nd ACM International Workshop on Context-Oriented Programming
June 2010
35 pages
ISBN:9781450305310
DOI:10.1145/1930021
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

  • CEKTRA
  • University of Maribor
  • AITO: Assoc Internationale por les Technologies Objects

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 22 June 2010

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. ContextJ
  2. EventCJ
  3. context translation rules

Qualifiers

  • Research-article

Conference

ECOOP '10
Sponsor:
  • AITO

Acceptance Rates

Overall Acceptance Rate 17 of 25 submissions, 68%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 07 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2018)Context-Oriented Algorithmic DesignProceedings of the 11th European Lisp Symposium on European Lisp Symposium10.5555/3323215.3323228(84-91)Online publication date: 18-Apr-2018
  • (2017)A Survey of Naturalistic Programming TechnologiesACM Computing Surveys10.1145/310948150:5(1-35)Online publication date: 26-Sep-2017
  • (2013)An Analysis of Language-Level Support for Self-Adaptive SoftwareACM Transactions on Autonomous and Adaptive Systems10.1145/2491465.24914668:2(1-29)Online publication date: 1-Jul-2013
  • (2012)Declarative layer composition in framework-based environmentsProceedings of the 4th ACM International Workshop on Context-Oriented Programming10.1145/2307436.2307437(1-6)Online publication date: 11-Jun-2012
  • (2011)EventCJProceedings of the tenth international conference on Aspect-oriented software development10.1145/1960275.1960305(253-264)Online publication date: 21-Mar-2011

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media