Skip to main content
Log in

Programming in a context-aware language

  • Published:
The Journal of Supercomputing Aims and scope Submit manuscript

Abstract

In the times of mobility and pervasiveness of computing, contextual information plays an increasingly crucial role in applications. This kind of information becomes a first class citizen in context-oriented programming (COP) paradigm. COP languages provide primitive constructs for easily writing applications that adapt their behaviour depending on the evolution of their operational environment, namely the context. We present these new constructs, the issues and the challenges that arise, reporting on our recent work on ML\(_\text {CoDa}\). It is a declarative language specifically designed for adaptation and equipped with a clear formal semantics and analysis tools. We will discuss some experiments done with a preliminary implementation of ML\(_\text {CoDa}\). Through them we will show how applications and context interactions can be better specified, analysed and controlled.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

Notes

  1. Available at https://github.com/vslab/YieldProlog.

References

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

  2. Appeltauer M, Hirschfeld R, Haupt M, Masuhara H (2011) ContextJ: context-oriented programming with Java. Comput Softw 28(1):272–292

    Google Scholar 

  3. Bodei C, Degano P, Ferrari GL, Galletta L (2016) Last mile’s resources. In: Semantics, Logics, and Calculi, LNCS 9560. Springer, Berlin, pp 33–53

    Google Scholar 

  4. Bodei C, Degano P, Ferrari GL, Galletta L (2016) A step towards checking security in IoT. In: Proceedings of ICE 2016, EPTCS, vol 223, pp 128–142

    Article  Google Scholar 

  5. Bodei C, Degano P, Ferrari GL, Galletta L (2016) Where do your IoT ingredients come from? In: Proceedings of the Coordination 2016, LNCS, vol 9686. Springer, Berlin, pp 35–50

    Google Scholar 

  6. Bodei C, Degano P, Ferrari GL, Galletta L (2017) Experimenting with a context-aware language. In: Malyshkin V (ed) Proceedings of 14th Conference on Parallel Computing Technologies, LNCS 10421. Springer, pp 3–17

  7. Bodei C, Degano P, Ferrari GL, Galletta L (2017) Tracing where IoT data are collected and aggregated. Log Methods Comput Sci 13(3:5):1–38

  8. Bodei C, Degano P, Galletta L, Focardi R, Tempesta M (2018) Transcompiling firewalls. In: Bauer L, Küsters R (eds) 7th International Conference on Principles of Security and Trust, POST 2018, LNCS, vol 10804. Springer, Berlin

    Google Scholar 

  9. Bodei C, Degano P, Galletta L, Focardi R, Tempesta M, Veronese L (2018) Language-independent synthesis of firewall policies. In: IEEE European Symposium on Security and Privacy, EuroS&P 2018. IEEE

  10. Bodei C, Degano P, Galletta L, Salvatori F (2014) Linguistic mechanisms for context-aware security. In: Proceedings of the 11th International Colloquium on Theoretical Aspects of Computing, LNCS 8687. Springer, Berlin, pp 61–79

    Chapter  Google Scholar 

  11. Bodei C, Degano P, Galletta L, Salvatori F (2016) Context-aware security: linguistic mechanisms and static analysis. J Comput Secur 24(4):427–477

    Article  Google Scholar 

  12. Bodei C, Dinh VD, Ferrari GL (2017) Checking global usage of resources handled with local policies. Sci Comput Program 133:20–50

    Article  Google Scholar 

  13. Busi M, Degano P, Galletta L (2018) Handling interference in a COP language. Submitted for publication

  14. Busi M, Degano P, Galletta L (2016) A semantics for disciplined concurrency in COP. In: Proceedings of the ICTCS 2016, CEUR Proceedings, vol 1720, pp 177–189

  15. Canciani A, Degano P, Ferrari GL, Galletta L (2015) A context-oriented extension of F#. In: FOCLASA 2015, EPTCS 201, pp 18–32

    Article  MathSciNet  Google Scholar 

  16. Code Quotation. https://docs.microsoft.com/en-Us/dotnet/fsharp/language-reference/code-quotations. Accessed 10 Sept 2018

  17. Costanza P (2005) Language constructs for context-oriented programming. In: Proceedings of the Dynamic Languages Symposium. ACM Press, pp 1–10

  18. Degano P, Ferrari GL, Galletta L (2014) A two-component language for COP. In: Proceedings of the 6th International Workshop on Context-Oriented Programming. ACM Digital Library

  19. Degano P, Ferrari GL, Galletta L (2014) A two-phase static analysis for reliable adaptation. In: Proceedings of the 12th International Conference on Software Engineering and Formal Methods, LNCS 8702. Springer, Berlin, pp 347–362

    Chapter  Google Scholar 

  20. Degano P, Ferrari GL, Galletta L (2016) Event-driven adaptation in COP. In: PLACES 2016, EPTCS 211, pp 37–45

    Article  Google Scholar 

  21. Degano P, Ferrari GL, Galletta L (2016) A two-component language for adaptation: design, semantics and program analysis. IEEE Trans Softw Eng. https://doi.org/10.1109/TSE.2015.2496941

    Article  Google Scholar 

  22. Galletta L (2014) Adaptivity: linguistic mechanisms and static analysis techniques. Ph.D. thesis, University of Pisa. https://etd.adm.unipi.it/theses/available/etd-05192014-153959/. Accessed 10 Sept 2018

  23. Hirschfeld R, Costanza P, Nierstrasz O (2008) Context-oriented programming. J Object Technol 7(3):125–151

    Article  Google Scholar 

  24. Kamina T, Aotani T, Masuhara H (2011) EventCJ a context-oriented programming language with declarative event-based context transition. In: Proceedings of the 10 International Conference on Aspect-Oriented software development (AOSD ’11). ACM, pp 253–264

  25. Kephart JO, Chess DM (2003) The vision of autonomic computing. IEEE Comput 36(1):41–50. https://doi.org/10.1109/MC.2003.1160055

    Article  Google Scholar 

  26. Kiczales G, Hilsdale E, Hugunin J, Kersten M, Palm J, Griswold W (2001) An overview of aspectj. In: Knudsen J (ed) ECOOP 2001 Object-Oriented Programming, LNCS 2072. Springer, Berlin, pp 327–354

    Chapter  Google Scholar 

  27. Lämmel R, Meijer E (2007) Revealing the X/O impedance mismatch–(changing lead into gold). In: Backhouse RC, Gibbons J, Hinze R, Jeuring J (eds) Datatype-Generic Programming-International Spring School, LNCS, vol 4719. Springer, Berlin, pp 285–367

    Chapter  Google Scholar 

  28. Loke SW (2004) Representing and reasoning with situations for context-aware pervasive computing: a logic programming perspective. Knowl Eng Rev 19(3):213–233

    Article  Google Scholar 

  29. Magee J, Kramer J (1996) Dynamic structure in software architectures. SIGSOFT Softw Eng Notes 21(6):3–14

    Article  Google Scholar 

  30. Microsoft Cognitive Service. https://azure.microsoft.com/en-us/services/cognitive-services/. Accessed 10 Sept 2018

  31. Microsoft .NET. https://www.microsoft.com/net/. Accessed 10 Sept 2018

  32. Orsi G, Tanca L (2011) Context modelling and context-aware querying. In: Moor O, Gottlob G, Furche T, Sellers A (eds) Datalog Reloaded, LNCS 6702. Springer, Berlin, pp 225–244

    Chapter  Google Scholar 

  33. Raspberry Pi. https://www.raspberrypi.org/. Accessed 10 Sept 2018

  34. Salehie M, Tahvildari L (2009) Self-adaptive software: Landscape and research challenges. ACM Trans Auton Adapt Syst 4(2):14:1–14:42

    Article  Google Scholar 

  35. Salvaneschi G, Ghezzi C, Pradella M (2012) Context-oriented programming: a software engineering perspective. J Syst Softw 85(8):1801–1817

    Article  Google Scholar 

  36. Spinczyk O, Gal A, Schröder-Preikschat W (2002) AspectC++: an aspect-oriented extension to the C++ programming language. In: CRPIT ’02. Australian Computer Society, Inc., pp 53–60

  37. Telegram. https://telegram.org/. Accessed 10 Sept 2018

  38. Walker D, Zdancewic S, Ligatti J (2003) A theory of aspects. SIGPLAN Not 38(9):127–139

    Article  Google Scholar 

  39. Wand M, Kiczales G, Dutchyn C (2004) A semantics for advice and dynamic join points in aspect-oriented programming. ACM Trans Program Lang Syst 26(5):890–910

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Letterio Galletta.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Bodei, C., Degano, P., Ferrari, GL. et al. Programming in a context-aware language. J Supercomput 75, 7750–7764 (2019). https://doi.org/10.1007/s11227-018-2603-3

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11227-018-2603-3

Keywords

Navigation