Skip to main content

Propagation of Behavioral Variations with Delegation Proxies

  • Chapter
  • First Online:
Transactions on Aspect-Oriented Software Development XII

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

Abstract

Scoping behavioral variations to dynamic extents is useful to support non-functional concerns that otherwise result in cross-cutting code. Unfortunately, such forms of scoping are difficult to obtain with traditional reflection or aspects. We propose delegation proxies, a dynamic proxy model that supports behavioral intercession through the interception of various interpretation operations. Delegation proxies permit different behavioral variations to be easily composed together. We show how delegation proxies enable behavioral variations that can propagate to dynamic extents. We demonstrate our approach with examples of behavioral variations scoped to dynamic extents that help simplify code related to safety, reliability, and monitoring.

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

Access this chapter

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 EPUB and 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

Institutional subscriptions

Notes

  1. 1.

    A similar mechanism is called encapsulator [Pas86].

  2. 2.

    A typical workaround for this problem is to constrain pointcut definitions: e.g., a pointcut p within an aspect A is rewritten: p && !cflow(adviceexecution())  && within( A ).

  3. 3.

    The notation Integer>>fib refers to the method fib of the class Integer. In Smalltalk, closures are expressed with square brackets \((\mathtt{[ \ldots ]})\) and booleans are objects. The method ifTrue: takes a closure as argument: if the receiver is the object true, the closure is evaluated by sending it the message value. The up-arrow \((\mathtt{\uparrow \dots })\) denotes a return expression.

  4. 4.

    We consider closures to be special kinds of literals.

  5. 5.

    In case of chain proxies, the original proxy is not necessarily the one that intercepted the operation but the root of the chain.

  6. 6.

    http://www.webcitation.org/6FOF4DFab.

  7. 7.

    http://scg.unibe.ch/research/DelegationProxies.

  8. 8.

    http://pharo.org/.

References

  1. Arnaud, J.-B., Denker, M., Ducasse, S., Pollet, D., Bergel, A., Suen, M.: Read-only execution for dynamic languages. In: Vitek, J. (ed.) TOOLS 2010. LNCS, vol. 6141, pp. 117–136. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  2. Aracic, I., Gasiunas, V., Mezini, M., Ostermann, K.: An overview of CaesarJ. In: Rashid, A., Akşit, M. (eds.) Transactions on Aspect-Oriented Software Development I. LNCS, vol. 3880, pp. 135–173. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  3. Apel, S., Leich, T., Saake, G.: Aspectual feature modules. IEEE Trans. Software Eng. 34(2), 162–180 (2008)

    Article  Google Scholar 

  4. Arnaud, J.-B.: Towards First Class References as a Security Infrastructure in Dynamically-Typed Languages. Ph.D. thesis, Université de Lille (2013)

    Google Scholar 

  5. Aksit, M., Wakita, K., Bosch, J., Bergmans, L., Yonezawa, A.: Abstracting object interactions using composition filter. In: Guerraoui, R., Nierstrasz, O., Riveill, M. (eds.) Object-Based Distributed Programming. LNCS, vol. 791, pp. 152–184. Springer, Heidelberg (1994)

    Chapter  Google Scholar 

  6. Bettini, L., Capecchi, S., Damiani, F.: On flexible dynamic trait replacement for Java-like languages. Sci. Comput. Program. 78(7), 907–932 (2013)

    Article  MATH  Google Scholar 

  7. Bettini, L., Capecchi, S., Giachino, E.: Featherweight wrap Java. In: Proceedings of the ACM symposium on Applied computing (2007)

    Google Scholar 

  8. Bergel, A., Ducasse, S., Nierstrasz, O., Wuyts, R.: Stateful traits and their formalization. J. Comput. Lang. Syst. Struct. 34(2–3), 83–108 (2008)

    Google Scholar 

  9. Bracha, G., Ungar, D.: Mirrors: design principles for meta-level facilities of object-oriented programming languages. In: Proceedings of the International Conference on Object-Oriented Programming, Systems, Languages, and Applications (2004)

    Google Scholar 

  10. Büchi, M., Weck, W.: Generic wrappers. In: Bertino, E. (ed.) ECOOP 2000 — Object-Oriented Programming. LNCS, vol. 1850, pp. 201–225. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  11. Chiba, S., Kiczales, G., Lamping, J.: Avoiding confusion in metacircularity: The meta-helix. In: Futatsugi, K., Matsuoka, S. (eds.) Object Technologies for Advanced Software. LNCS, vol. 1049, pp. 157–172. Springer, Heidelberg (1996)

    Chapter  Google Scholar 

  12. Deutsch, P.L.: Building control structures in the Smalltalk-80 system. BYTE Magazine Special Issue on Smalltalk 6(8), 322–346 (1981)

    MathSciNet  Google Scholar 

  13. Denker, M., Suen, M., Ducasse, S.: The meta in meta-object architectures. In: Paige, R.F., Meyer, B. (eds.) TOOLS EUROPE 2008. LNBIP, vol. 11, pp. 218–237. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  14. Eugster, P.: Uniform proxies for Java. In: Proceedings of Object-oriented programming systems, languages, and applications (2006)

    Google Scholar 

  15. Flatt, M., Krishnamurthi, S., Felleisen, M.: Classes and mixins. In: Proceedings of Principles of Programming Languages (1998)

    Google Scholar 

  16. Futamura, Y.: Partial evaluation of computation process–an approach to a compiler-compiler. Higher-Order and Symbolic Comput. 12(4), 381–391 (1999)

    Article  MATH  Google Scholar 

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

    Article  Google Scholar 

  18. Harrison, W., Ossher, H.: Subject-oriented programming (a critique of pure objects). In: Proceedings of Object-Oriented Programming, Systems, Languages, and Applications (1993)

    Google Scholar 

  19. Haupt, M., Schippers, H.: A machine model for aspect-oriented programming. In: Ernst, E. (ed.) ECOOP 2007. LNCS, vol. 4609, pp. 501–524. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  20. Kniesel, G.: Type-safe delegation for run-time component adaptation. In: Guerraoui, R. (ed.) ECOOP 1999. LNCS, vol. 1628, pp. 351–366. Springer, Heidelberg (1999)

    Google Scholar 

  21. Kristensen, B.B.: Object-oriented modeling with roles. Springer, London (1996)

    Book  Google Scholar 

  22. Lieberman, H.: Using prototypical objects to implement shared behavior in object oriented systems. In: Proceedings of Object-Oriented Programming, Systems, Languages, and Applications (1986)

    Google Scholar 

  23. Masuhara, H., Kiczales, G., Dutchyn, C.: A compilation and optimization model for aspect-oriented programs. In: Hedin, G. (ed.) CC 2003. LNCS, vol. 2662, pp. 46–60. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  24. Peck, M.M., Bouraqadi, N., Denker, M., Ducasse, S., Fabresse, L.: Efficient proxies in smalltalk. In: Proceedings of ESUG International Workshop on Smalltalk Technologies (2011)

    Google Scholar 

  25. Ostermann, K.: Dynamically composable collaborations with delegation layers. In: Proceedings of European Conference on Object-Oriented Programming (2002)

    Google Scholar 

  26. Pascoe, G.A.: Encapsulators: a new software paradigm in smalltalk-80. In: Proceedings of Object-Oriented Programming, Systems, Languages, and Applications (1986)

    Google Scholar 

  27. Pluquet, F., Langerman, S., Wuyts, R.: Executing code in the past: efficient in-memory object graph versioning. In: Proceedings of Object-Oriented Programming, Systems, Languages, and Applications (2009)

    Google Scholar 

  28. Ressia, J., Gîrba, T., Nierstrasz, O., Perin, F., Renggli, L.: Talents: an environment for dynamically composing units of reuse. Softw. Pract. Experience 44(4), 413–432 (2014)

    Article  Google Scholar 

  29. Schárli, N., Ducasse, S., Nierstrasz, O., Black, A.P.: Traits: composable units of behaviour. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743, pp. 248–274. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  30. Stephen Strickland, T., Tobin-Hochstadt, Sam., Findler, R.B., Flatt, M.: Chaperones and impersonators: run-time support for reasonable interposition. In: Proceedings of Object-Oriented Programming, Systems, Languages, and Applications (2012)

    Google Scholar 

  31. Smith, R.B., Ungar, D.: A simple and unifying approach to subjective objects. Theory and Practice of Object Systems (TAPOS) 2, 161–178 (1996). Special issue on Subjectivity in Object-Oriented Systems

    Article  Google Scholar 

  32. Tanter, É.: Expressive scoping of dynamically-deployed aspects. In: Proceedings of Aspect-Oriented Software Development (2008)

    Google Scholar 

  33. Tanter, É.: Execution levels for aspect-oriented programming. In: Proceedings of Aspect-Oriented Software Development (2010)

    Google Scholar 

  34. Teruel, C., Cassou, D., Ducasse, S.: Object Graph Isolation with Proxies. In: Workshop on Dynamic Languages and Applications - European Conference on Object-Oriented Programming (2013)

    Google Scholar 

  35. Tanter, É., Fabry, J., Douence, R., Noyé, J., Südholt, M.: Expressive scoping of distributed aspects. In: Proceedings Aspect-Oriented Software Development (2009)

    Google Scholar 

  36. Tanter, É., Noyé, J., Caromel, D., Cointe, P.: Partial behavioral reflection: Spatial and temporal selection of reification. Languages, and Applications. In: Proceedings of Object-Oriented Programming, Systems (2003)

    Google Scholar 

  37. Van Cutsem, T., Miller, M.S.: Proxies: design principles for robust object-oriented intercession APIs. In: DLS ’10 Proceedings of the 6th symposium on Dynamic languages (2010)

    Google Scholar 

  38. Van Cutsem, T., Miller, M.S.: Trustworthy proxies. In: Castagna, G. (ed.) ECOOP 2013. LNCS, vol. 7920, pp. 154–178. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  39. von Löwis, M., Denker, M., Nierstrasz, O.: Context-oriented programming: Beyond layers. In: Proceedings of International Conference on Dynamic Languages (2007)

    Google Scholar 

  40. Viega, J., Tutt, B., Behrends, R.: Automated elegation is a viable alternative to multiple inheritance in class based languages. University of Virginia, Charlottesville (1998)

    Google Scholar 

Download references

Acknowledgments

We thank Jorge Ressia, Mircea Lungu, Niko Schwarz and Jan Kurš for support and feedback about ideas in the paper. We gratefully acknowledge the financial support of the Swiss National Science Foundation for the project “Agile Software Assessment” (SNSF project Np. 200020-144126/1, Jan 1, 2013 - Dec. 30, 2015) and of the French General Directorate for Armament (DGA).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Camille Teruel .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

Teruel, C., Wernli, E., Ducasse, S., Nierstrasz, O. (2015). Propagation of Behavioral Variations with Delegation Proxies. In: Chiba, S., Tanter, É., Ernst, E., Hirschfeld, R. (eds) Transactions on Aspect-Oriented Software Development XII. Lecture Notes in Computer Science(), vol 8989. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-662-46734-3_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-662-46734-3_2

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-662-46733-6

  • Online ISBN: 978-3-662-46734-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics