Skip to main content

Abstracting Context in Event-Based Software

  • Chapter

Part of the book series: Lecture Notes in Computer Science ((TAOSD,volume 7271))

Abstract

With the recent immersion of advanced mobile devices in the daily lives of millions, pervasive computing is becoming a reality. Developing pervasive software systems is inherently difficult though it requires to deal with heterogeneous infrastructure besides peer-to-peer communication and device mobility. Thus, programming support for such applications must provide loose coupling between different participants, as well as loose coupling between applications and communication protocols. Event-based programming provides an appealing paradigm to decouple participants, however many event-based systems and languages have hardwired communication protocols, which limits their adaptability to heterogeneous deployment environments.

In this paper we address this issue by abstracting the context in which events are created and handled, including protocols used to convey, compose, and consume these events. More precisely, we propose to extend an event-based programming model with context aspectsconspects for short. We demonstrate the elegant usage of conspects through several examples based on their implementation in EventJava and illustrate how they allow to modularize event-based pervasive software. We also provide a thorough empirical investigation of the performance overheads and benefits of conspects, including the costs of weaving them dynamically. Through empirical evaluations, we assess the benefits of conspects for switching protocols without any changes to the base applications through three case studies with EventJava. The three studies are (1) a tornado monitoring system deployed on different architectures ranging from desktop x86 to embedded LEON3, (2) a mobile social networking suite with protocols for different scenarios, and (3) the introduction of a novel adaptive communication protocol in our mobile social network suite as well as in a novel robotic swarm application.

This research is partially funded by the Swiss National Science Foundation through project number PBLAP2-127668 and by the US NSF through grants 0644013 and 0834529 as well as through DARPA grant number N11AP20014.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Carzaniga, A., Rosenblum, D.S., Wolf, A.L.: Design and evaluation of a wide-area event notification service. TOCS 19 (2001)

    Google Scholar 

  2. Appeltauer, M., Hirschfeld, R., Haupt, M., Lincke, J., Perscheid, M.: A comparison of context-oriented programming languages. In: COP 2009: International Workshop on Context-Oriented Programming, New York, NY, USA, pp. 1–6 (2009)

    Google Scholar 

  3. Appeltauer, M., Hirschfeld, R., Masuhara, H.: Improving the development of context-dependent Java applications with Contextj. In: COP 2009: International Workshop on Context-Oriented Programming, New York, NY, USA, pp. 1–5 (2009)

    Google Scholar 

  4. BBN Technologies. Quality Objects, http://quo.bbn.com

  5. Benton, N., Cardelli, L., Fournet, C.: Modern concurrency abstractions for C#. TOPLAS 26(5), 769–804 (2004)

    Article  Google Scholar 

  6. Cachin, C., Guerraoui, R., Rodrigues, L.: Reliable and secure distributed programming (2011)

    Google Scholar 

  7. Capra, L., Emmerich, W., Mascolo, C.: Carisma: context-aware reflective middleware system for mobile applications. TSE 29(10), 929–945 (2003)

    Google Scholar 

  8. Cheng, J., Cheng, W., Nagpal, R.: Robust and self-repairing formation control for swarms of mobile agents. In: AAAI 2005, pp. 59–64 (2005)

    Google Scholar 

  9. Cugola, G., Di Nitto, E., Fuggetta, A.: The JEDI event-based infrastructure and its application to the development of the OPSS WFMS. TSE 27(9), 827–850 (2001)

    Google Scholar 

  10. Dedecker, J., Van Cutsem, T., Mostinckx, S., D’Hondt, T., De Meuter, W.: Ambient-Oriented Programming in AmbientTalk. In: Thomas, D. (ed.) ECOOP 2006. LNCS, vol. 4067, pp. 230–254. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  11. Douence, R., Fradet, P., Südholt, M.: Composition, reuse and interaction analysis of stateful aspects. In: AOSD 2004, pp. 141–150 (2004)

    Google Scholar 

  12. Drossopoulou, S., Petrounias, A., Buckley, A., Eisenbach, S.: SCHOOL: a small chorded object-oriented language. Electr. Notes Theor. Comput. Sci. 135(3), 37–47 (2006)

    Article  Google Scholar 

  13. Eclipse Foundation. The AspectJ programming language (2009), http://eclipse.org/aspectj/

  14. Ericsson Computer Science Laboratory. The Erlang pogramming language, http://www.erlang.org

  15. Eugster, P.: Type-based publish/subscribe: concepts and experiences. TOPLAS 29(1) (2007)

    Google Scholar 

  16. Eugster, P., Garbinato, B., Holzer, A.: Location-based publish/subscribe. In: NCA 2005, pp. 279–282 (2005)

    Google Scholar 

  17. Eugster, P., Jayaram, K.R.: EventJava: An Extension of Java for Event Correlation. In: Drossopoulou, S. (ed.) ECOOP 2009. LNCS, vol. 5653, pp. 570–594. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  18. Fiege, L., Mezini, M., Mühl, G., Buchmann, A.P.: Engineering Event-Based Systems with Scopes. In: Magnusso, B. (ed.) ECOOP 2002. LNCS, vol. 2374, pp. 309–333. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  19. Fournet, C., Gonthier, C.: The reflexive chemical abstract machine and the join calculus. In: POPL 1996, pp. 372–385 (1996)

    Google Scholar 

  20. Frey, D., Roman, G.-C.: Context-Aware Publish Subscribe in Mobile Ad Hoc Networks. In: Murphy, A.L., Dell’Acqua, P. (eds.) COORDINATION 2007. LNCS, vol. 4467, pp. 37–55. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  21. Friedman-Hill, E.: Jess (2008), http://www.jessrules.com/jess/

  22. Fritsch, D., Wegener, K., Schraft, R.D.: Control of a robotic swarm for the elimination of marine oil pollutions. In: SIS 2007, pp. 29–36 (2007)

    Google Scholar 

  23. Haahr, M., Meier, R., Nixon, P., Cahill, V., Jul, E.: Filtering and scalability in the ECO distributed event model. In: PDSE 2000, pp. 83–92 (2000)

    Google Scholar 

  24. Haller, P., Van Cutsem, T.: Implementing Joins Using Extensible Pattern Matching. In: Lea, D., Zavattaro, G. (eds.) COORDINATION 2008. LNCS, vol. 5052, pp. 135–152. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  25. Hirschfeld, R., Costanza, P., Haupt, M.: An Introduction to Context-Oriented Programming with ContextS. In: Lämmel, R., Visser, J., Saraiva, J. (eds.) GTTSE 2007. LNCS, vol. 5235, pp. 396–407. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  26. Hirschfeld, R., Costanza, P., Nierstrasz, O.: Context-oriented programming. Journal of Object Technology 7(3), 125–151 (2008)

    Article  Google Scholar 

  27. Holzer, A., Ziarek, L., Jayaram, K.R., Eugster, P.: Putting events in context. In: AOSD 2011, pp. 241–252 (2011)

    Google Scholar 

  28. Huang, Y., Garcia-Molina, H.: Parameterized subscriptions in publish/subscribe systems. Data Knowl. Eng. 60(3), 435–450 (2007)

    Article  Google Scholar 

  29. Oracle Inc. Java reflection API (2011), http://download.oracle.com/javase/tutorial/reflect/index.html

  30. Sun Microsystems Inc. Java message service - specification, version 1.1. Technical report, Sun Microsystems Inc. (2005), http://java.sun.com/products/jms/docs.html

  31. Von Itzstein, S.G., Kearney, D.A.: The expression of common concurrency patterns in Join Java. In: PDPTA 2004, pp. 1021–1025 (2004)

    Google Scholar 

  32. Jayaram, K.R., Eugster, P.: Context-oriented programming with EventJava. In: COP 2009, pp. 570–594 (2009)

    Google Scholar 

  33. JGuru. Performance costs involved in Java reflection, http://www.jguru.com/faq/view.jsp?EID=246569

  34. Kakalis, N.M.P., Ventikos, Y.: Robotic swarm concept for efficient oil spill confrontation. Journal of Hazardous Materials 154(1-3), 880–887 (2008)

    Article  Google Scholar 

  35. Kiczales, G., Lamping, J., Menhdhekar, A., Maeda, C., Lopes, C., Loingtier, J.-M., Irwin, J.: Aspect-Oriented Programming. In: Aksit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 220–242. Springer, Heidelberg (1997)

    Chapter  Google Scholar 

  36. Lamport, L.: Time, clocks, and the ordering of events in a distributed system. CACM 21(7), 558–565 (1978)

    MATH  Google Scholar 

  37. Mattern, F.: Virtual time and global states of distributed systems. In: PDDA 1989, pp. 215–226 (1989)

    Google Scholar 

  38. Meier, R., Cahill, V.: Steam: event-based middleware for wireless ad hoc networks. In: DEBS 2002, pp. 639–644 (2002)

    Google Scholar 

  39. Mills, D.L.: Internet time synchronization: the network time protocol. In: TSE, pp. 1482–1493 (1991)

    Google Scholar 

  40. Navarro, L.D.B., Südholt, M., Vanderperren, W., De Fraine, B., Suvée, D.: Explicitly distributed AOP using AWED. In: AOSD 2006, pp. 51–62 (2006)

    Google Scholar 

  41. Nystrom, N., Clarkson, M.R., Myers, A.C.: Polyglot: An Extensible Compiler Framework for Java. In: Hedin, G. (ed.) CC 2003. LNCS, vol. 2622, pp. 138–152. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  42. Oki, B., Pfluegl, M., Siegel, A., Skeen, D.: The information bus - an architecture for extensible distributed systems. In: SOSP 1993, pp. 58–68 (1993)

    Google Scholar 

  43. Paula, I.S., Eisenbach, S.: JCThorn: extending thorn with joins and chords. Technical report, Imperial College London (June 2010), http://www.doc.ic.ac.uk/teaching/distinguished-projects/2010/i.solla-paula.pdf

  44. Pizlo, F., Ziarek, L., Blanton, E., Maj, P., Vitek, J.: High-level programming of embedded hard real-time devices. In: EuroSys 2010, pp. 69–82 (2010)

    Google Scholar 

  45. Plociniczak, H., Eisenbach, S.: JErlang: Erlang with Joins. In: Clarke, D., Agha, G. (eds.) COORDINATION 2010. LNCS, vol. 6116, pp. 61–75. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  46. Rajan, H., Leavens, G.T.: Ptolemy: A Language with Quantified, Typed Events. In: Vitek, J. (ed.) ECOOP 2008. LNCS, vol. 5142, pp. 155–179. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  47. Rasmussen, E.N.: Refined supercell and tornado forecast parameters. Weather and Forecasting 18, 530–535 (2003)

    Article  Google Scholar 

  48. Reppy, J.H., Xiao, Y.: Specialization of CML message-passing primitives. In: POPL 2007, pp. 315–326 (2007)

    Google Scholar 

  49. Russo, C.V.: Join patterns for visual basic. In: OOPSLA 2008, pp. 53–72 (2008)

    Google Scholar 

  50. Schneider, F.B.: Implementing fault-tolerant services using the state machine approach: a tutorial. ACM Computing Surveys 22(4), 299–319 (1990)

    Article  Google Scholar 

  51. Soulé, R., Hirzel, M., Grimm, R., Gedik, B., Andrade, H., Kumar, V., Wu, K.-L.: A Universal Calculus for Stream Processing Languages. In: Gordon, A.D. (ed.) ESOP 2010. LNCS, vol. 6012, pp. 507–528. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  52. Sulzmann, M., Lam, E.S.L., Van Weert, P.: Actors with Multi-headed Message Receive Patterns. In: Lea, D., Zavattaro, G. (eds.) COORDINATION 2008. LNCS, vol. 5052, pp. 315–330. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  53. Tanter, É.: Contextual values. In: DLS 2008, pp. 1–10 (2008)

    Google Scholar 

  54. Tatlock, Z., Tucker, C., Shuffelton, D., Jhala, R., Lerner, S.: Deep typechecking and refactoring, pp. 37–52 (2008)

    Google Scholar 

  55. von Löwis, M., Denker, M., Nierstrasz, O.: Context-oriented programming: beyond layers. In: ICDL 2007, pp. 143–156 (2007)

    Google Scholar 

  56. Wohlstadter, E., Jackson, S., Devanbu, P.: DADO: enhancing middleware to support crosscutting features in distributed, heterogeneous systems. In: ICSE 2003, pp. 174–186 (2003)

    Google Scholar 

  57. Yoon, J., Liu, M., Noble, B.: Random waypoint considered harmful. In: INFOCOM 2003, pp. 1312–1321 (2003)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

Holzer, A., Ziarek, L., Jayaram, K.R., Eugster, P. (2012). Abstracting Context in Event-Based Software. In: Leavens, G.T., Chiba, S., Haupt, M., Ostermann, K., Wohlstadter, E. (eds) Transactions on Aspect-Oriented Software Development IX. Lecture Notes in Computer Science, vol 7271. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-35551-6_4

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-35551-6_4

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-35550-9

  • Online ISBN: 978-3-642-35551-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics