skip to main content
10.1145/1960275.1960305acmconferencesArticle/Chapter ViewAbstractPublication PagesmodularityConference Proceedingsconference-collections
research-article

EventCJ: a context-oriented programming language with declarative event-based context transition

Published:21 March 2011Publication History

ABSTRACT

This paper proposes EventCJ, a context-oriented programming (COP) language that can modularly control layer activation based on user-defined events. In addition to defining context-specific behaviors by using existing COP constructs, the EventCJ programmer declares events to specify when and on which instance layer switching should happen, and layer transition rules to specify which layers should be activated/deactivated upon events. These constructs enable controlling layer activation on a per-instance basis, separately from a base program. We also demonstrate an approach to verify safety properties of layer transitions by using a model checker. With these advantages, EventCJ enables more modular descriptions of context-aware programs, especially when layer switching is triggered in many places of a program, or by activities external to the base program. We implemented a prototype EventCJ compiler with Eclipse IDE support.

References

  1. Chris Allan, et al. Adding trace matching with free variables to AspectJ. In Proceedings of OOPSLA'05, pages 345--364, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Malte Appeltauer, et al. A comparison of context-oriented programming languages. In COP '09: International Workshop on Context-Oriented Programming, pages 1--6, New York, NY, USA, 2009. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Malte Appeltauer, Robert Hirschfeld, Michael Haupt, and Hidehiko Masuhara. ContextJ: Context-oriented programming with Java. Computer Software, 2011. to appear.Google ScholarGoogle Scholar
  4. Malte Appeltauer, Robert Hirschfeld, and Hidehiko Masuhara. Improving the development of context-dependent Java application with ContextJ. In COP'09, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Malte Appeltauer, et al. Event-specific software composition in context-oriented programming. In Proceedings of the International Conference on Software Composition 2010 (SC'10), volume 6144 of LNCS, pages 50--65, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Nick Benton, Luca Cardelli, and Cédric Fournet. Modern concurrency abstractions for C#. ACM Transactions on Programming Languages and Systems, 26(5):769--804, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Martin Bravenboer, Éric Tanter, and Eelco Visser. Declarative, formal, and extensible syntax definition for aspectj. In OOPSLA '06, pages 209--228, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Martin Bravenboer and Eelco Visser. Concrete syntax for objects: domain-specific language embedding and assimilation without restrictions. In OOPSLA'04, pages 365--383, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Mark Bull, Lorna Smith, Martin Westhead, David Henty, and Robert Davey. Benchmarking java grande applications. In the Second International Conference on The Practical Applications of Java, pages 63--73, 2000.Google ScholarGoogle Scholar
  11. Pascal Costanza and Theo D'Hondt. Feature description for context-oriented programming. In DSPL'08, 2008.Google ScholarGoogle Scholar
  12. 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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Pascal Costanza and Robert Hirschfeld. Reflective layer activation in contextl. In SAC'07, pages 1280--1285, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Pascal Costanza, Robert Hirschfeld, and Wolfgang De Meuter. Efficient layer activation for switching context-dependent behavior. In JMLC 2006, volume 4228 of LNCS, pages 84--103, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Brecht Desmet, Jorge Vallejos, Pascal Costanza, and Robert Hirschfeld. Layered design approach for context-aware systems. In VaMoS'07, 2007.Google ScholarGoogle Scholar
  16. 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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Carlo Ghezzi, Matteo Praella, and Guido Salvaneschi. Context-oriented programming in highly concurrent systems. In COP'10, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Carlo Ghezzi, Matteo Praella, and Guido Salvaneschi. Programming language support to context-aware adaptation - a case-study with Erlang. In SEAMS'10, pages 59--68, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. 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.Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Robert Hirschfeld, Pascal Costanza, and Oscar Nierstrasz. Context-oriented programming. Journal of Object Technology, 7(3):125--151, 2008.Google ScholarGoogle ScholarCross RefCross Ref
  21. Gerard J. Holzmann. The model checker SPIN. IEEE Transaction on Software Engineering, 23(5):279--295, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Tetsuo Kamina, Tomoyuki Aotani, and Hidehiko Masuhara. Designing event-based context transition in context-oriented programming. In COP'10, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Tetsuo Kamina and Tetsuo Tamai. Towards safe and flexible object adaptation. In COP'09, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Lennart C. L. Kats and Eelco Visser. The Spoofax language workbench. Rules for declarative specification of languages and IDEs. In Proceedings of the 25th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2010), 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Hidehiko Masuhara, Yusuke Endoh, and Akinori Yonezawa. A fine-grained join point model for more reusable aspects. In APLAS'06, volume 4279 of LNCS, pages 131--147, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Angel Núñez, Jacques Noyé, and Vaidas Gasiūnas. Declarative definition of contexts with polymorphic events. In COP'09, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Tobias Rho, Günter Kniesel, and Malte Appeltauer. Fine-grained generic aspects. In FOAL'06, 2006.Google ScholarGoogle Scholar
  28. Tobias Rho, Mark Schmatz, and Armin B. Cremers. Towards context-sensitive service aspects. In OT4AML, 2006.Google ScholarGoogle Scholar
  29. Tetsuo Tamai, Naoyasu Ubayashi, and Ryoichi Ichiyama. An adaptive object model with dynamic role binding. In International Conference on Software Engineering (ICSE 2005), pages 166--175, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Tetsuo Tamai, Naoyasu Ubayashi, and Ryoichi Ichiyama. Objects as actors assuming roles in the environment. In Software Engineering for Multi-Agent Systems V, volume 4408 of LNCS, pages 185--203, 2007.Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Martin von Löwis, Marcus Denker, and Oscar Nierstrasz. Context-oriented programming: beyond layers. In ICDL '07: Proceedings of the 2007 international conference on Dynamic languages, pages 143--156, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Robert J. Walker and Kevin Viggers. Implementing protocols via declarative event patterns. In Proceedings of FSE'04, pages 159--169, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. EventCJ: a context-oriented programming language with declarative event-based context transition

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        AOSD '11: Proceedings of the tenth international conference on Aspect-oriented software development
        March 2011
        326 pages
        ISBN:9781450306058
        DOI:10.1145/1960275
        • General Chair:
        • Paulo Borba,
        • Program Chair:
        • Shigeru Chiba

        Copyright © 2011 ACM

        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]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 21 March 2011

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        Overall Acceptance Rate41of139submissions,29%

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader