Chemical foundations of distributed aspects

  • Nicolas Tabareau
  • Éric Tanter


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.



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


  1. 1.
    Proceedings of the 9th ACM International Conference on Aspect-Oriented Software Development (AOSD 2010), Rennes and Saint Malo, France, March 2010. ACM PressGoogle Scholar
  2. 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)Google Scholar
  3. 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)Google Scholar
  4. 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 PressGoogle Scholar
  5. 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)Google Scholar
  6. 6.
    Benton, N., Cardelli, L., Fournet, C.: Modern concurrency abstractions for C\(^{\sharp }\). ACM Trans. Program. Lang. Syst. 26(5), 769–804 (2004)CrossRefzbMATHGoogle Scholar
  7. 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)Google Scholar
  8. 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)Google Scholar
  9. 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). SpringerGoogle Scholar
  10. 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)CrossRefGoogle Scholar
  11. 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)Google Scholar
  12. 12.
    Clements, J., Felleisen, M.: A tail-recursive machine with stack inspection. ACM Trans. Program. Lang. Syst. 26(6), 1029–1052 (2004)CrossRefGoogle Scholar
  13. 13.
    Clifton, C., Leavens, G.T.: MiniMAO\(_1\): an imperative core language for studying aspect-oriented reasoning. Sci. Comput. Program. 63, 312–374 (2006)CrossRefzbMATHGoogle Scholar
  14. 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)Google Scholar
  15. 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). SpringerGoogle Scholar
  16. 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. 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. SpringerGoogle Scholar
  18. 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)MathSciNetCrossRefzbMATHGoogle Scholar
  19. 19.
    Duzan, G., Loyall, J., Schantz, R., Shapiro, R., Zinky, J.: Building adaptive distributed applications with middleware and aspects. In: Lieberherr [35], pp. 66–73Google Scholar
  20. 20.
    Elrad, T., Filman, R.E., Bader, A.: Aspect-oriented programming. Communications of the ACM, 44(10) (October 2001)Google Scholar
  21. 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)Google Scholar
  22. 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)Google Scholar
  23. 23.
    Fournet, C., Laneve, C., Maranget, L., Rémy, D.: Inheritance in the join calculus. J Logic Algebr. Program. 57(1), 23–70 (2003)MathSciNetCrossRefzbMATHGoogle Scholar
  24. 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)Google Scholar
  25. 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 PressGoogle Scholar
  26. 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). SpringerGoogle Scholar
  27. 27.
    Hilsdale, E., Hugunin, J.: Advice weaving in AspectJ. In: Lieberherr [35], pp. 26–35Google Scholar
  28. 28.
    Jagadeesan, R., Jeffrey, A., Riely, J.: Typed parametric polymorphism for aspects. Sci. Comput. Program. 63, 267–296 (2006)MathSciNetCrossRefzbMATHGoogle Scholar
  29. 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)zbMATHGoogle Scholar
  30. 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)Google Scholar
  31. 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). SpringerGoogle Scholar
  32. 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 PressGoogle Scholar
  33. 33.
    Leger, P., Tanter, É., Douence, R.: Modular and flexible causality control on the web. Sci. Comput. Program. 78(9), 1538–1558 (2013)CrossRefGoogle Scholar
  34. 34.
    Leger, P., Tanter, É., Fukuda, H.: An expressive stateful aspect language. Sci. Comput. Program. 102(1), 108–141 (2015)CrossRefGoogle Scholar
  35. 35.
    Lieberherr, K. (ed.) Proceedings of the 3rd ACM International Conference on Aspect-Oriented Software Development (AOSD 2004), Lancaster, UK (March 2004). ACM PressGoogle Scholar
  36. 36.
    Mandel, L., Maranget, L.: The JoCaml language release 4.00. Inria (August 2012)Google Scholar
  37. 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)Google Scholar
  38. 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)Google Scholar
  39. 39.
    Nishizawa, M., Chiba, S., Tatsubori, M.: Remote pointcut—a language construct for distributed AOP. In: Lieberherr [35], pp. 7–15Google Scholar
  40. 40.
    Obrovac, M., Tedeschi, C.: Experimental evaluation of a hierarchical chemical computing platform. Int. J. Netw. Comput. 3(1), 37–54 (2013)CrossRefGoogle Scholar
  41. 41.
    Oliveira, B.C.d.S., Schrijvers, T., and Cook, W.R.: EffectiveAdvice: discplined advice with explicit effects. In: AOSD 2010 [1], pp. 109–120Google Scholar
  42. 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)MathSciNetCrossRefzbMATHGoogle Scholar
  43. 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)Google Scholar
  44. 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)CrossRefGoogle Scholar
  45. 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. 46.
    Riely, J., Hennessy, M.: A typed language for distributed mobile processes. In: Proceedings of POPL’98, pp. 378–390. ACM Press (1998)Google Scholar
  47. 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)Google Scholar
  48. 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). SpringerGoogle Scholar
  49. 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)Google Scholar
  50. 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)Google Scholar
  51. 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)Google Scholar
  52. 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 5Google Scholar
  53. 53.
    Tabareau, N.: A theory of distributed aspects. In: AOSD 2010 [1], pp. 133–144Google Scholar
  54. 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 PressGoogle Scholar
  55. 55.
    Tanter, É., Fabry, J., Douence, R., Noyé, J., Südholt, M.: Scoping strategies for distributed aspects. Sci. Comput. Program. 75(12), 1235–1261 (2010)CrossRefzbMATHGoogle Scholar
  56. 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)CrossRefGoogle Scholar
  57. 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). SpringerGoogle Scholar
  58. 58.
    Toledo, R., Núñez, A., Tanter, É., Noyé, J.: Aspectizing Java access control. IEEE Trans. Softw. Eng. 38(1), 101–117 (2012)CrossRefGoogle Scholar
  59. 59.
    Truyen, E., Joosen, W.: Run-time and atomic weaving of distributed aspects. Trans. Aspect Oriented Softw. Dev. II(4242), 147–181 (2006)CrossRefzbMATHGoogle Scholar
  60. 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). SpringerGoogle Scholar
  61. 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 PressGoogle Scholar
  62. 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)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag GmbH Germany, part of Springer Nature 2018

Authors and Affiliations

  1. 1.InriaNantesFrance
  2. 2.PLEIAD Lab, Computer Science Dept (DCC)University of ChileSantiagoChile

Personalised recommendations