skip to main content
10.1145/2786545.2786550acmconferencesArticle/Chapter ViewAbstractPublication PagesecoopConference Proceedingsconference-collections
research-article

Method Safety Mechanism for Asynchronous Layer Deactivation

Published: 04 July 2015 Publication History

Abstract

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.

References

[1]
Malte Appeltauer, Robert Hirschfeld, Michael Haupt, and Hidehiko Masuhara. ContextJ: Context-oriented programming with Java. Computer Software, 28(1):272--292, 2011.
[2]
Malte Appeltauer, Robert Hirschfeld, and Hidehiko Masuhara. Improving the development of context-dependent Java application with ContextJ. In COP'09, 2009.
[3]
Malte Appeltauer, Robert Hirschfeld, Hidehiko Masuhara, Michael Haupt, and Kazunori Kawauchi. Event-specific software composition in context-oriented programming. In SC'10, volume 6144 of LNCS, pages 50--65, 2010.
[4]
Engineer Bainomugisha, Jorge Vallejos, Coen De Roover, Andoni Lombide Carreton, and Wolfgang De Meuter. Interruptible context-dependent executions: A fresh look at programming context-aware applications. In Onward! 2012, pages 67--84, 2012.
[5]
Dirk Bäumer, Dirk Riehle, Wolf Siberski, and Martina Wulf. The role object pattern. In PLoP'97, 1997.
[6]
Gilad Bracha, Peter von der Ahé, Vassili Bykov, Yaron Kashai, William Maddox, and Eliot Miranda. Modules as objects in Newspeak. In ECOOP'10, pages 405--428, 2010.
[7]
Pascal Costanza and Theo D'Hondt. Feature descriptions for context-oriented programming. In DSPL'08, 2008.
[8]
Pascal Costanza and Robert Hirschfeld. Language constructs for context-oriented programming -- an overview of ContextL. In DLS'05, pages 1--10, 2005.
[9]
Brecht Desmet, Jorge Vallejos, Pascal Costanza, and Robert Hirschfeld. Layered design approach for context-aware systems. In VaMoS'07, 2007.
[10]
Sebastián González, Micolás Cardozo, Kim Mens, Alfredo Cádiz, Jean-Christophe Libbrecht, and Julien Goffaux. Subjective-C: Bringing context to mobile platform programming. In SLE'11, volume 6563 of LNCS, pages 246--265, 2011.
[11]
Sebastián González, Kim Mens, and Alfredo Cádiz. Context-oriented programming with the ambient object systems. Journal of Universal Computer Science, 14(20):3307--3332, 2008.
[12]
Robert Hirschfeld, Pascal Costanza, and Oscar Nierstrasz. Context-oriented programming. Journal of Object Technology, 7(3):125--151, 2008.
[13]
Atsushi Igarashi, Robert Hirschfeld, and Hidehiko Masuhara. A type system for dynamic layer composition. In FOOL'12, 2012.
[14]
Hiroaki Inoue, Atsushi Igarashi, Malte Appeltauer, and Robert Hirschfeld. Towards type-safe JCop: A type system for layer inheritance and first-class layers. In COP'14, 2014.
[15]
Tetsuo Kamina, Tomoyuki Aotani, and Atsushi Igarashi. On-demand layer activation for type-safe deactivation. In COP'14, 2014.
[16]
Tetsuo Kamina, Tomoyuki Aotani, and Hidehiko Masuhara. EventCJ: a context-oriented programming language with declarative event-based context transition. In AOSD'11, pages 253--264, 2011.
[17]
Tetsuo Kamina, Tomoyuki Aotani, and Hidehiko Masuhara. A core calculus of composite layers. In FOAL'13, pages 7--12, 2013.
[18]
Tetsuo Kamina, Tomoyuki Aotani, and Hidehiko Masuhara. Introducing composite layers in EventCJ. IPSJ Transactions on Programming, 6(1):1--8, 2013.
[19]
Tetsuo Kamina, Tomoyuki Aotani, and Hidehiko Masuhara. Generalized layer activation mechanism through contexts and subscribers. In MODULARITY'15, pages 14--28, 2015.
[20]
Jens Lincke, Robert Krahn, and Robert Hirschfeld. Implementing scoped method tracing with ContextJS. In COP'11, 2011.
[21]
Guido Salvaneschi, Carlo Ghezzi, and Matteo Pradella. ContextErlang: Introducing context-oriented programming in the actor model. In AOSD'12, 2012.
[22]
David Ungar, Harold Ossher, and Doug Kimelman. Korz: Simple, symmetric, subjective, context-oriented programming. In Onward! 2014, pages 113--131, 2014.

Cited By

View all
  • (2018)Method safety mechanism for asynchronous layer deactivationScience of Computer Programming10.1016/j.scico.2018.01.006156:C(104-120)Online publication date: 1-May-2018

Index Terms

  1. Method Safety Mechanism for Asynchronous Layer Deactivation

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    COP '15: Proceedings of the 7th ACM International Workshop on Context-Oriented Programming
    July 2015
    54 pages
    ISBN:9781450336543
    DOI:10.1145/2786545
    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 the author(s) 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

    In-Cooperation

    • CTU: Czech Technical University in Prague
    • AITO: Assoc Internationale por les Technologies Objects

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 04 July 2015

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. Layer-introduced base method
    2. ServalCJ

    Qualifiers

    • Research-article
    • Research
    • Refereed limited

    Conference

    ECOOP '15

    Acceptance Rates

    Overall Acceptance Rate 17 of 25 submissions, 68%

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

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

    Other Metrics

    Citations

    Cited By

    View all
    • (2018)Method safety mechanism for asynchronous layer deactivationScience of Computer Programming10.1016/j.scico.2018.01.006156:C(104-120)Online publication date: 1-May-2018

    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