Skip to main content
Log in

Chemical foundations of distributed aspects

  • Published:
Distributed Computing Aims and scope Submit manuscript

Abstract

Distributed applications are challenging to program because they have to deal with a plethora of concerns, including synchronization, locality, replication, security and fault tolerance. Aspect-oriented programming (AOP) is a paradigm that promotes better modularity by providing means to encapsulate crosscutting concerns in entities called aspects. Over the last years, a number of distributed aspect-oriented programming languages and systems have been proposed, illustrating the benefits of AOP in a distributed setting. Chemical calculi are particularly well-suited to formally specify the behavior of concurrent and distributed systems. The join calculus is a functional name-passing calculus, with both distributed and object-oriented extensions. It is used as the basis of concurrency and distribution features in several mainstream languages like C# (Polyphonic C#, now C\(\omega \)), OCaml (JoCaml), and Scala Joins. Unsurprisingly, practical programming in the join calculus also suffers from modularity issues when dealing with crosscutting concerns. We propose the aspect join calculus, an aspect-oriented and distributed variant of the join calculus that addresses crosscutting and provides a formal foundation for distributed AOP. We develop a minimal aspect join calculus that allows aspects to advise chemical reactions. We show how to deal with causal relations in pointcuts and how to support advanced customizable aspect weaving semantics. We also provide the foundation for a decentralized distributed aspect weaving architecture. The semantics of the aspect join calculus is given by a chemical operational semantics. We give a translation of the aspect join calculus into the core join calculus, and prove this translation correct by a bisimilarity argument. This translation is used to implement Aspect JoCaml on top of JoCaml.

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.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15

Similar content being viewed by others

Notes

  1. http://spring.io.

  2. http://www.jboss.org.

  3. http://cloudstack.apache.org/.

  4. This article builds upon a previous conference publication [53]. Much of the text has been completely rewritten. The aspect join calculus has been simplified and clarified, in particular by removing the type system and the management of classes, because they are orthogonal to the extensions considered in this work. In addition, the technical treatment has been extended in many ways, including more expressive quantification, per-reaction weaving, and decentralized weaving. The translation from the aspect join calculus to the standard join calculus has been updated accordingly, as well as the proof of correctness of the translation. Finally, an implementation based on JoCaml is presented and provided online.

  5. There is a good reason why we choose a variant of the join calculus with objects; we discuss it later in Sect. 3.4, once the basics of aspects in the calculus are established.

  6. We further discuss dealing with causality in Sect. 5.1.

  7. Syntactically, the main differences with our calculus are that conjunction is noted | instead of & and disjunction of rules is noted \(\wedge \) instead of or. Also, there are no objects with labels, only channels.

References

  1. Proceedings of the 9th ACM International Conference on Aspect-Oriented Software Development (AOSD 2010), Rennes and Saint Malo, France, March 2010. ACM Press

  2. Aracic, I., Gasiunas, V., Mezini, M., Ostermann, K.: An overview of CaesarJ. In: Transactions on Aspect-Oriented Software Development, vol. 3880 of Lecture Notes in Computer Science, pp. 135–173. Springer (February 2006)

  3. Avgustinov, P., Christensen, A.S., Hendren, L., Kuzins, S., Lhoták, J., Lhoták, O., de Moor, O., Sittampalam, G., Sereni, D., Tibble, J.: abc: an extensible AspectJ compiler. In: Transactions on Aspect-Oriented Software Development, vol. 3880 of Lecture Notes in Computer Science, pp. 293–334. Springer (2006)

  4. Benavides, N., Luis, D., Südholt, M., Vanderperren, W., De Fraine, B., Suvée, D.: Explicitly distributed AOP using AWED. In: Proceedings of the 5th ACM International Conference on Aspect-Oriented Software Development (AOSD 2006), pp. 51–62, Bonn, Germany, March 2006. ACM Press

  5. Benavides, N., Luis, D., Südholt, M., Vanderperren, W., Verheecke, B.: Modularization of distributed web services using AWED. In: Proceedings of the 8th International Symposium on Distributed Objects and Applications (DOA 2006), volume 4276 of Lecture Notes in Computer Science, pp. 1449–1466. Springer (October 2006)

  6. Benton, N., Cardelli, L., Fournet, C.: Modern concurrency abstractions for C\(^{\sharp }\). ACM Trans. Program. Lang. Syst. 26(5), 769–804 (2004)

    Article  MATH  Google Scholar 

  7. Biba, K.J.: Integrity considerations for secure computer systems. Technical Report ESD-TR-76-372, USAF Electronic Systems Division, Bedford, MA, USA (April 1977)

  8. Bodden, E., Forster, F., Steimann, F.: Avoiding infinite recursion with stratified aspects. In: Proceedings of Net.ObjectDays 2006, Lecture Notes in Informatics, pp. 49–54. GI-Edition (2006)

  9. Bodden, E., Stolz, V.: Tracechecks: defining semantic interfaces with temporal logic. In: Löwe, W., Südholt, M. (eds.) Proceedings of the 5th International Symposium on Software Composition (SC 2006), vol. 4089 of Lecture Notes in Computer Science, pp. 147–162, Vienna, Austria (March 2006). Springer

  10. Bodden, E., Tanter, É., Inostroza, M.: Join point interfaces for safe and flexible decoupling of aspects. ACM Trans. Softw. Eng. Methodol. 23(1), 7:1–7:41 (2014)

    Article  Google Scholar 

  11. Chen, H.-Y.: COCA: Computation offload to clouds using AOP. In: Proceedings of the 12th IEEE/ACM International Symposium on Cluster, Cloud and Grid Computing (CCGrid), pp. 466–473, Ottawa, ON, USA (2012)

  12. Clements, J., Felleisen, M.: A tail-recursive machine with stack inspection. ACM Trans. Program. Lang. Syst. 26(6), 1029–1052 (2004)

    Article  Google Scholar 

  13. Clifton, C., Leavens, G.T.: MiniMAO\(_1\): an imperative core language for studying aspect-oriented reasoning. Sci. Comput. Program. 63, 312–374 (2006)

    Article  MATH  Google Scholar 

  14. Curti, M., Degano, P., Baldari, C.T.: Causal \(\pi \)-calculus for biochemical modelling. In: Computational Methods in Systems Biology, vol. 2602 of Lecture Notes in Computer Science, pp. 21–34. Springer-Verlag (February 2003)

  15. De Fraine, B., Ernst, E., Südholt, M.: Essential AOP: the A calculus. In: D’Hondt, T. (ed.) Proceedings of the 24th European Conference on Object-oriented Programming (ECOOP 2010), number 6183 in Lecture Notes in Computer Science, pp. 101–125, Maribor, Slovenia (June 2010). Springer

  16. Douence, R., Fradet, P., Südholt, M.: Trace-based aspects. In: Filman, R.E., Elrad, T., Clarke, S., Akşit, M. (eds.) Aspect-Oriented Software Development, pp. 201–217. Addison-Wesley, Boston (2005)

    Google Scholar 

  17. Douence, R., Teboul, L.: A pointcut language for control-flow. In: Karsai, G., and Visser, E. (eds.) Proceedings of the 3rd ACM SIGPLAN/SIGSOFT Conference on Generative Programming and Component Engineering (GPCE 2004), vol. 3286 of Lecture Notes in Computer Science, pp. 95–114, Vancouver, Canada, October 2004. Springer

  18. Dutchyn, C., Tucker, D.B., Krishnamurthi, S.: Semantics and scoping of aspects in higher-order languages. Sci Comput Program 63(3), 207–239 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  19. Duzan, G., Loyall, J., Schantz, R., Shapiro, R., Zinky, J.: Building adaptive distributed applications with middleware and aspects. In: Lieberherr [35], pp. 66–73

  20. Elrad, T., Filman, R.E., Bader, A.: Aspect-oriented programming. Communications of the ACM, 44(10) (October 2001)

  21. Fournet, C., Gonthier, G.: The join calculus: a language for distributed mobile programming. In: Applied Semantics, vol. 2395 of Lecture Notes in Computer Science, pp. 268–332. Springer (2002)

  22. Fournet, C., Gonthier, G.: The reflexive chemical abstract machine and the join-calculus. In: Proceedings of POPL’96, pp. 372–385. ACM (January 1996)

  23. Fournet, C., Laneve, C., Maranget, L., Rémy, D.: Inheritance in the join calculus. J Logic Algebr. Program. 57(1), 23–70 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  24. Fournet, C., Le Fessant, F., Maranget, L., Schmitt, A.: JoCaml: a language for concurrent distributed and mobile programming. In: Advanced Functional Programming, vol. 2638 of Lecture Notes in Computer Science, pp. 129–158. Springer (2003)

  25. Gasiunas, V., Satabin, L., Mezini, M., Núñez, A., Noyé, J.: EScala: modular event-driven object interactions in Scala. In: Proceedings of the 10th ACM International Conference on Aspect-Oriented Software Development (AOSD 2011), pp. 227–240, Porto de Galinhas, Brazil (March 2011). ACM Press

  26. Haller, P., Van Cutsem, T.: Implementing joins using extensible pattern matching. In: Lea, D., and Zavattaro, G. (eds): Proceedings of the 10th International Conference on Coordination Models and Languages (COORDINATION 2008), vol. 5052 of Lecture Notes in Computer Science, pp. 135–152, Oslo, Norway (June 2008). Springer

  27. Hilsdale, E., Hugunin, J.: Advice weaving in AspectJ. In: Lieberherr [35], pp. 26–35

  28. Jagadeesan, R., Jeffrey, A., Riely, J.: Typed parametric polymorphism for aspects. Sci. Comput. Program. 63, 267–296 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  29. Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. International Series in Computer Science. Prentice Hall, Upper Saddle River (1993)

    MATH  Google Scholar 

  30. Kiczales, G., Irwin, J., Lamping, J., Loingtier, J., Lopes, C.V., Maeda, C., Mendhekar, A.: Aspect oriented programming. In: Special Issues in Object-Oriented Programming. Max Muehlhaeuser (general editor) et al. (1996)

  31. Kiczales, G., Hilsdale, E., Hugunin, J., Kersten, M., Palm, J., Griswold, W.: An overview of AspectJ. In: Knudsen, J.L. (ed) Proceedings of the 15th European Conference on Object-Oriented Programming (ECOOP 2001), number 2072 in Lecture Notes in Computer Science, pp. 327–353, Budapest, Hungary (June 2001). Springer

  32. Kiczales, G., Mezini, M.: Aspect-oriented programming and modular reasoning. In: Proceedings of the 27th international conference on Software engineering (ICSE 2005), pp. 49–58, St. Louis, MO, USA, 2005. ACM Press

  33. Leger, P., Tanter, É., Douence, R.: Modular and flexible causality control on the web. Sci. Comput. Program. 78(9), 1538–1558 (2013)

    Article  Google Scholar 

  34. Leger, P., Tanter, É., Fukuda, H.: An expressive stateful aspect language. Sci. Comput. Program. 102(1), 108–141 (2015)

    Article  Google Scholar 

  35. Lieberherr, K. (ed.) Proceedings of the 3rd ACM International Conference on Aspect-Oriented Software Development (AOSD 2004), Lancaster, UK (March 2004). ACM Press

  36. Mandel, L., Maranget, L.: The JoCaml language release 4.00. Inria (August 2012)

  37. Masuhara, H., Kiczales, G., Dutchyn, C.: A compilation and optimization model for aspect-oriented programs. In: Hedin, G. (ed), Proceedings of Compiler Construction (CC2003), vol. 2622 of Lecture Notes in Computer Science, pp. 46–60. Springer (2003)

  38. Mdhaffar, A., Ben Halima, R., Juhnke, E., Jmaiel, M.: AOP4CSM: An aspect-oriented programming approach for cloud service monitoring. In: Proceedings of the 11th IEEE International Conference on Computer and Information Technology (CIT), pp. 363–370 (2011)

  39. Nishizawa, M., Chiba, S., Tatsubori, M.: Remote pointcut—a language construct for distributed AOP. In: Lieberherr [35], pp. 7–15

  40. Obrovac, M., Tedeschi, C.: Experimental evaluation of a hierarchical chemical computing platform. Int. J. Netw. Comput. 3(1), 37–54 (2013)

    Article  Google Scholar 

  41. Oliveira, B.C.d.S., Schrijvers, T., and Cook, W.R.: EffectiveAdvice: discplined advice with explicit effects. In: AOSD 2010 [1], pp. 109–120

  42. Oliveira, B.C.D.S., Schrijvers, T., Cook, W.R.: MRI: modular reasoning about interference in incremental programming. J. Funct. Program. 22, 797–852 (2012)

    Article  MathSciNet  MATH  Google Scholar 

  43. Ostermann, K., Mezini, M., Bockisch, C.: Expressive pointcuts for increased modularity. In: Black, A.P. (ed.) Proceedings of the European Conference on Object-Oriented Programming (ECOOP), vol. 3586 of LNCS, pp. 214–240. Springer (2005)

  44. Pawlak, R., Seinturier, L., Duchien, L., Florin, G., Legond-Aubry, F., Martelli, L.: JAC: an aspect-oriented distributed dynamic framework. Softw Pract Exp 34(12), 1119–1148 (2004)

    Article  Google Scholar 

  45. Pazat, J.-L., Priol, T., Tedeschi, C.: Towards a chemistry-inspired middleware to program the internet of services. ERCIM News 85(34), 34–35 (2011)

    Google Scholar 

  46. Riely, J., Hennessy, M.: A typed language for distributed mobile processes. In: Proceedings of POPL’98, pp. 378–390. ACM Press (1998)

  47. Rinard, M., Salcianu, A., Bugrara, S.: A classification system and analysis for aspect-oriented programs. In: Proceedings of the 12th ACM Symposium on Foundations of Software Engineering (FSE 12), pp. 147–158. ACM Press (2004)

  48. Samarati, P., di Vimercati, S.C.: Access control: policies, models, and mechanisms. In: FOSAD ’00: Revised versions of lectures given during the IFIP WG 1.7 International School on Foundations of Security Analysis and Design on Foundations of Security Analysis and Design, pp. 137–196, London, UK (2001). Springer

  49. Soares, S., Laureano, E., Borba, P.: Implementing distribution and persistence aspects with AspectJ. In: Proceedings of the 17th International Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA 2002), pp. 174–190, Seattle, Washington, USA, November 2002. ACM Press. ACM SIGPLAN Notices 37(11)

  50. Steimann, F.: The paradoxical success of aspect-oriented programming. In: Proceedings of the 21st ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA 2006), pp. 481–497, Portland, Oregon, USA, October 2006. ACM Press. ACM SIGPLAN Notices 41(10)

  51. Steimann, F., Pawlitzki, T., Apel, S., Kästner, C.: Types and modularity for implicit invocation with implicit announcement. ACM Transactions on Software Engineering and Methodology 20(1):Article 1 (2010)

  52. Sullivan, K., Griswold, W.G., Rajan, H., Song, Y., Cai, Y., Shonle, M., Tewari, N.: Modular aspect-oriented design with XPIs. In: ACM Transactions on Software Engineering and Methodology, vol. 20(2) (2010). Article 5

  53. Tabareau, N.: A theory of distributed aspects. In: AOSD 2010 [1], pp. 133–144

  54. Tabareau, N., Figueroa, I., Tanter, É.: A typed monadic embedding of aspects. In: Kinzle, J. (ed.) Proceedings of the 12th International Conference on Aspect-Oriented Software Development (AOSD 2013), pp. 171–184, Fukuoka, Japan (March 2013). ACM Press

  55. Tanter, É., Fabry, J., Douence, R., Noyé, J., Südholt, M.: Scoping strategies for distributed aspects. Sci. Comput. Program. 75(12), 1235–1261 (2010)

    Article  MATH  Google Scholar 

  56. Tanter, É., Figueroa, I., Tabareau, N.: Execution levels for aspect-oriented programming: design, semantics, implementations and applications. Sci. Comput. Program. 80(1), 311–342 (2014)

    Article  Google Scholar 

  57. Tanter, É., Toledo, R.: A versatile kernel for distributed AOP. In: Proceedings of the IFIP International Conference on Distributed Applications and Interoperable Systems (DAIS 2006), vol. 4025 of Lecture Notes in Computer Science, pp. 316–331, Bologna, Italy (2006). Springer

  58. Toledo, R., Núñez, A., Tanter, É., Noyé, J.: Aspectizing Java access control. IEEE Trans. Softw. Eng. 38(1), 101–117 (2012)

    Article  Google Scholar 

  59. Truyen, E., Joosen, W.: Run-time and atomic weaving of distributed aspects. Trans. Aspect Oriented Softw. Dev. II(4242), 147–181 (2006)

    Article  MATH  Google Scholar 

  60. Wadler, P.: How to replace failure by a list of successes. In: Proceedings of the Conference on Functional Programming Languages and Computer Architecture (FPCA ’85), vol. 201 of Lecture Notes in Computer Science, pp. 113–128, Nancy, France (September 1985). Springer

  61. Walker, D., Zdancewic, S., Ligatti, J.: A theory of aspects. In: Proceedings of the 8th ACM SIGPLAN Conference on Functional Programming (ICFP 2003), pp. 127–139, Uppsala, Sweden (September 2003). ACM Press

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

    Article  Google Scholar 

Download references

Acknowledgements

We thank the anonymous reviewers for their valuable and detailed suggestions on how to improve this article.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Éric Tanter.

Additional information

The implementation of Aspect JoCaml, together with running examples, is available online at: https://tabareau.github.io/AJoCaml/.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Tabareau, N., Tanter, É. Chemical foundations of distributed aspects. Distrib. Comput. 32, 193–216 (2019). https://doi.org/10.1007/s00446-018-0334-6

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00446-018-0334-6

Keywords

Navigation