Nothing Special   »   [go: up one dir, main page]

skip to main content
research-article

ContextErlang

Published: 01 May 2015 Publication History

Abstract

Self-adaptive software modifies its behavior at run time to satisfy changing requirements in a dynamic environment. Context-oriented programming (COP) has been recently proposed as a specialized programming paradigm for context-aware and adaptive systems. COP mostly focuses on run time adaptation of the application's behavior by supporting modular descriptions of behavioral variations. However, self-adaptive applications must satisfy additional requirements, such as distribution and concurrency, support for unforeseen changes and enforcement of correct behavior in the presence of dynamic change. Addressing these issues at the language level requires a holistic design that covers all aspects and takes into account the possibly cumbersome interaction of those features, for example concurrency and dynamic change.We present ContextErlang, a COP programming language in which adaptive abstractions are seamlessly integrated with distribution and concurrency. We define ContextErlang's formal semantics, validated through an executable prototype, and we show how it supports formal proofs that the language design ensures satisfaction of certain safety requirements. We provide empirical evidence that ContextErlang is an effective solution through case studies and a performance assessment. We also show how the same design principles that lead to the development of ContextErlang can be followed to systematically design contextual extensions of other languages. A concrete example is presented concerning ContextScala.

References

[1]
G. Salvaneschi, C. Ghezzi, M. Pradella, ContextErlang: introducing context-oriented programming in the actor model, in: Proceedings of the 11th Annual International Conference on Aspect-Oriented Software Development, ACM, New York, NY, USA, 2012, pp. 191-202.
[2]
M. Salehie, L. Tahvildari, Self-adaptive software: landscape and research challenges, ACM Trans. Auton. Adapt. Syst., 4 (2009) 14:1-14:42.
[3]
J.O. Kephart, D.M. Chess, The vision of autonomic computing, Computer, 36 (2003) 41-50.
[4]
P. Oreizy, N. Medvidovic, R.N. Taylor, Architecture-based runtime software evolution, in: ICSE '98: Proceedings of the 20th International Conference on Software Engineering, IEEE Computer Society, Washington, DC, USA, 1998, pp. 177-186.
[5]
R.N. Taylor, N. Medvidovic, P. Oreizy, Architectural styles for runtime software adaptation, in: 3rd European Conference on Software Architecture, IEEE, 2009, pp. 171-180.
[6]
J. Kramer, J. Magee, Self-managed systems: an architectural challenge, in: 2007 Future of Software Engineering, IEEE Computer Society, Washington, DC, USA, 2007, pp. 259-268.
[7]
R. Hirschfeld, P. Costanza, O. Nierstrasz, Context-oriented programming, J. Object Technol., 7 (2008).
[8]
G. Salvaneschi, C. Ghezzi, M. Pradella, Context-oriented programming: a software engineering perspective, J. Syst. Softw., 85 (2012) 1801-1817.
[9]
P.K. McKinley, S.M. Sadjadi, E.P. Kasten, B.H.C. Cheng, Composing adaptive software, Computer, 37 (2004) 56-64.
[10]
G. Kiczales, E. Hilsdale, J. Hugunin, M. Kersten, J. Palm, W. Griswold, An overview of AspectJ, in: Lecture Notes in Computer Science, vol. 2072, Springer, Berlin/Heidelberg, 2001, pp. 327-354.
[11]
A. Popovici, T. Gross, G. Alonso, Dynamic weaving for aspect-oriented programming, in: Proceedings of the 1st International Conference on Aspect-Oriented Software Development, ACM, New York, NY, USA, 2002, pp. 141-147.
[12]
A. Popovici, G. Alonso, T. Gross, Just-in-time aspects: efficient dynamic weaving for Java, in: Proceedings of the 2nd International Conference on Aspect-Oriented Software Development, ACM, New York, NY, USA, 2003, pp. 100-109.
[13]
R. Pawlak, L. Seinturier, L. Duchien, G. Florin, JAC: a flexible solution for aspect-oriented programming in Java, in: Lecture Notes in Computer Science, vol. 2192, Springer, 2001, pp. 1-24.
[14]
R. Pawlak, L. Seinturier, L. Duchien, G. Florin, F. Legond-Aubry, L. Martelli, JAC: an aspect-based distributed dynamic framework, 2004.
[15]
M. Appeltauer, R. Hirschfeld, M. Haupt, H. Masuhara, ContextJ: context-oriented programming with Java, Inf. Media Technol., 6 (2011) 399-419.
[16]
P. Costanza, R. Hirschfeld, Language constructs for context-oriented programming: an overview of ContextL, in: Proceedings of the 2005 Symposium on Dynamic Languages, 2005.
[17]
G. Salvaneschi, C. Ghezzi, M. Pradella, Context-oriented programming: a programming paradigm for autonomic systems. arXiv:1105.0069
[18]
D. Notkin, D. Garlan, W.G. Griswold, K. Sullivan, Adding implicit invocation to languages: three approaches, in: LNCS, vol. 742, 1993.
[19]
M. Appeltauer, R. Hirschfeld, H. Masuhara, M. Haupt, K. Kawauchi, Event-specific software composition in context-oriented programming, in: LNCS, vol. 6144, 2010.
[20]
J. Lincke, M. Appeltauer, B. Steinert, R. Hirschfeld, An open implementation for context-oriented layer composition in ContextJS, Sci. Comput. Program., 76 (2011) 1194-1209.
[21]
K. Tetsuo, A. Tomoyuki, H. Masuhara, EventCJ: a context-oriented programming language with declarative event-based context transition, in: Proceedings of the 10th International Conference on Aspect-Oriented Software Development, AOSD '11.
[22]
C. Ghezzi, M. Pradella, G. Salvaneschi, Programming language support to context-aware adaptation - a case-study with Erlang, in: SEAMS: Software Engineering for Adaptive and Self-Managing Systems, International Workshop, 2010.
[23]
P. Costanza, R. Hirschfeld, Reflective layer activation in contextL, in: SAC '07: Proceedings of the 2007 ACM Symposium on Applied Computing, 2007.
[24]
P. Costanza, T. D'Hondt, Feature descriptions for context-oriented programming, in: Software Product Lines, 12th International Conference (SPLC), 2008, pp. 9-14.
[25]
S. González, N. Cardozo, K. Mens, A. Cádiz, J.-C. Libbrecht, J. Goffaux, Subjective-C: bringing context to mobile platform programming, in: Lecture Notes in Computer Science, Springer-Verlag, Eindhoven, The Netherlands, 2010.
[26]
J. Schäfer, A. Poetzsch-Heffter, JCoBox: generalizing active objects to concurrent components, in: LNCS, vol. 66, Springer, 2010, pp. 275-299.
[27]
F.S. DeBoer, D. Clarke, E.B. Johnsen, A complete guide to the future, in: LNCS, vol. 4421, Springer-Verlag, 2007, pp. 316-330.
[28]
M. Flatt, S. Krishnamurthi, M. Felleisen, A programmer's reduction semantics for classes and mixins, in: Formal Syntax and Semantics of Java, Springer-Verlag, London, UK, 1999, pp. 241-269.
[29]
M. Felleisen, R. Hieb, The revised report on the syntactic theories of sequential control and state, Theor. Comput. Sci., 103 (1992) 235-271.
[30]
M. Clavel, F. Durán, S. Eker, P. Lincoln, N. Martí-Oliet, J. Meseguer, C.L. Talcott, All About Maude - A High-Performance Logical Framework. How to Specify, Program and Verify Systems in Rewriting Logic, Springer, 2007.
[31]
T.F. Serbanuta, G. Rosu, J. Meseguer, A rewriting logic approach to operational semantics, Inf. Comput., 207 (2009) 305-340.
[32]
M. Felleisen, R.B. Findler, M. Flatt, Semantics Engineering with PLT Redex, The MIT Press, 2009.
[33]
T.F. Şerbanu¿¿, G. Roşu, K-Maude: a rewriting based tool for semantics of programming languages, in: Lecture Notes in Computer Science, vol. 6381, 2010, pp. 104-122.
[34]
S. Eker, J. Meseguer, A. Sridharanarayanan, The Maude LTL model checker, in: Electronic Notes in Theoretical Computer Science, vol. 71, Elsevier, 2002.
[35]
M. Logan, E. Merritt, R. Carlsson, Erlang and OTP in Action, Manning Publications, 2010.
[36]
G. Salvaneschi, C. Ghezzi, M. Pradella, An analysis of language-level support for self-adaptive software, ACM Trans. Auton. Adapt. Syst., 8 (2013) 7:1-7:29.
[37]
M. Haupt, M. Mezini, Micro-measurements for dynamic aspect-oriented systems, in: LNCS, vol. 3263, Springer, Berlin/Heidelberg, 2004.
[38]
M. Appeltauer, R. Hirschfeld, M. Haupt, J. Lincke, M. Perscheid, A comparison of context-oriented programming languages, in: COP '09: International Workshop on Context-Oriented Programming, ACM, New York, NY, USA, 2009, pp. 1-6.
[39]
M. Appeltauer, M. Haupt, R. Hirschfeld, Layered method dispatch with INVOKEDYNAMIC: an implementation study, in: COP '10, 2010, pp. 4:1-4:6.
[40]
D. Garlan, S.-W. Cheng, A.-C. Huang, B. Schmerl, P. Steenkiste, Rainbow: architecture-based self-adaptation with reusable infrastructure, Computer, 37 (2004) 46-54.
[41]
E. Bruneton, T. Coupaye, M. Leclercq, V. Quéma, J.-B. Stefani, The FRACTAL component model and its support in Java: experiences with auto-adaptive and reconfigurable systems, Softw. Pract. Exp., 36 (2006) 1257-1284.
[42]
G. Salvaneschi, C. Ghezzi, M. Pradella, JavaCtx: seamless toolchain integration for context-oriented programming, in: COP '11, 2011.
[43]
S. González, K. Mens, P. Heymans, Highly dynamic behaviour adaptability through prototypes with subjective multimethods, in: Proceedings of the 2007 Symposium on Dynamic Languages, 2007, pp. 77-88.
[44]
C. Ghezzi, M. Pradella, G. Salvaneschi, Context-oriented programming in highly concurrent systems, in: Proceedings of the 2nd International Workshop on Context-Oriented Programming, ACM, New York, NY, USA, 2010.
[45]
A. Popovici, T. Gross, G. Alonso, Dynamic weaving for aspect-oriented programming, in: Proceedings of the 1st International Conference on Aspect-Oriented Software Development, 2002.
[46]
V. Gasiunas, L. Satabin, M. Mezini, A. Núñez, J. Noyé, EScala: modular event-driven object interactions in Scala, in: Proceedings of the Tenth International Conference on Aspect-Oriented Software Development, ACM, New York, NY, USA, 2011, pp. 227-240.
[47]
H. Rajan, G.T. Leavens, Ptolemy: a language with quantified, typed events, in: LNCS, vol. 5142, Springer, Berlin, 2008, pp. 155-179.
[48]
H. Schippers, D. Janssens, M. Haupt, R. Hirschfeld, Delegation-based semantics for modularizing crosscutting concerns, in: Proceedings of the 23rd ACM SIGPLAN Conference on Object-Oriented Programming Systems Languages and Applications, ACM, New York, NY, USA, 2008, pp. 525-542.
[49]
H. Schippers, T. Molderez, D. Janssens, A graph-based operational semantics for context-oriented programming, in: International Workshop on Context-oriented Programming at ECOOP'10.
[50]
G. Holzmann, The Spin Model Checker: Primer and Reference Manual, first edition, Addison-Wesley Professional, 2003.
[51]
D. Clarke, I. Sergey, A semantics for context-oriented programming with layers, in: International Workshop on Context-Oriented Programming, COP '09, ACM, New York, NY, USA, 2009, pp. 10:1-10:6.
[52]
R. Hirschfeld, A. Igarashi, H. Masuhara, ContextFJ: a minimal core calculus for context-oriented programming, in: Proceedings of the 10th International Workshop on Foundations of Aspect-Oriented Languages, ACM, New York, NY, USA, 2011, pp. 19-23.
[53]
A. Igarashi, B.C. Pierce, P. Wadler, Featherweight Java: a minimal core calculus for Java and GJ, in: ACM Transactions on Programming Languages and Systems, pp. 132-146.
[54]
A. Igarashi, R. Hirschfeld, H. Masuhara, A type system for dynamic layer composition, in: Proceedings of the Workshop on the Foundations of Object-Oriented Languages (FOOL), Co-Located with the Conference on Object-Oriented Programming, Systems, Languages, and Applications, ACM, Tucson, Arizona, USA, 2012.
[55]
R.B. Smith, D. Ungar, A simple and unifying approach to subjective objects, Theory Pract. Object Syst., 2 (1996) 161-178.
[56]
D. Batory, J.N. Sarvela, A. Rauschmayer, Scaling step-wise refinement, in: Proceedings of the 25th International Conference on Software Engineering, ICSE '03, IEEE Computer Society, Washington, DC, USA, 2003, pp. 187-197.
[57]
F. Steimann, On the representation of roles in object-oriented and conceptual modelling, Data Knowl. Eng., 35 (2000) 83-106.
[58]
M. Pradel, M. Odersky, Scala roles - a lightweight approach towards reusable collaborations, in: International Conference on Software and Data, Technologies (ICSOFT '08), 2008.
[59]
S. Ducasse, O. Nierstrasz, N. Schärli, R. Wuyts, A.P. Black, Traits: a mechanism for fine-grained reuse, ACM Trans. Program. Lang. Syst., 28 (2006) 331-388.
[60]
G. Bracha, W. Cook, Mixin-based inheritance, in: Proc. OOPSLA 90, ACM Press, 1990, pp. 303-311.
[61]
Y. Smaragdakis, D. Batory, Implementing layered designs with mixin layers, in: ECCOP 98: Proceedings of the 12th European Conference on Object-Oriented Programming, Springer, 1998, pp. 550-570.
[62]
K. Ostermann, Dynamically composable collaborations with delegation layers, in: Proceedings of the 16th European Conference on Object-Oriented Programming, Springer-Verlag, London, UK, 2002, pp. 89-110.

Cited By

View all
  • (2024)Learning Recovery Strategies for Dynamic Self-healing in Reactive SystemsProceedings of the 19th International Symposium on Software Engineering for Adaptive and Self-Managing Systems10.1145/3643915.3644097(133-142)Online publication date: 15-Apr-2024
  • (2020)The SOTA approach to engineering collective adaptive systemsInternational Journal on Software Tools for Technology Transfer (STTT)10.1007/s10009-020-00554-322:4(399-415)Online publication date: 1-Aug-2020
  • (2018)Engineering Collectives of Self-driving Vehicles: The SOTA ApproachLeveraging Applications of Formal Methods, Verification and Validation. Distributed Systems10.1007/978-3-030-03424-5_6(79-93)Online publication date: 5-Nov-2018
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image Science of Computer Programming
Science of Computer Programming  Volume 102, Issue C
May 2015
158 pages

Publisher

Elsevier North-Holland, Inc.

United States

Publication History

Published: 01 May 2015

Author Tags

  1. Concurrency
  2. Context
  3. Context-oriented programming
  4. Distribution
  5. Self-adaptive software

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 26 Sep 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Learning Recovery Strategies for Dynamic Self-healing in Reactive SystemsProceedings of the 19th International Symposium on Software Engineering for Adaptive and Self-Managing Systems10.1145/3643915.3644097(133-142)Online publication date: 15-Apr-2024
  • (2020)The SOTA approach to engineering collective adaptive systemsInternational Journal on Software Tools for Technology Transfer (STTT)10.1007/s10009-020-00554-322:4(399-415)Online publication date: 1-Aug-2020
  • (2018)Engineering Collectives of Self-driving Vehicles: The SOTA ApproachLeveraging Applications of Formal Methods, Verification and Validation. Distributed Systems10.1007/978-3-030-03424-5_6(79-93)Online publication date: 5-Nov-2018
  • (2017)Quality-aware runtime adaptation in complex event processingProceedings of the 12th International Symposium on Software Engineering for Adaptive and Self-Managing Systems10.1109/SEAMS.2017.10(140-151)Online publication date: 20-May-2017

View Options

View options

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media