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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
A similar mechanism is called encapsulator [Pas86].
- 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.
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.
We consider closures to be special kinds of literals.
- 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.
- 7.
- 8.
References
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)
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)
Apel, S., Leich, T., Saake, G.: Aspectual feature modules. IEEE Trans. Software Eng. 34(2), 162–180 (2008)
Arnaud, J.-B.: Towards First Class References as a Security Infrastructure in Dynamically-Typed Languages. Ph.D. thesis, Université de Lille (2013)
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)
Bettini, L., Capecchi, S., Damiani, F.: On flexible dynamic trait replacement for Java-like languages. Sci. Comput. Program. 78(7), 907–932 (2013)
Bettini, L., Capecchi, S., Giachino, E.: Featherweight wrap Java. In: Proceedings of the ACM symposium on Applied computing (2007)
Bergel, A., Ducasse, S., Nierstrasz, O., Wuyts, R.: Stateful traits and their formalization. J. Comput. Lang. Syst. Struct. 34(2–3), 83–108 (2008)
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)
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)
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)
Deutsch, P.L.: Building control structures in the Smalltalk-80 system. BYTE Magazine Special Issue on Smalltalk 6(8), 322–346 (1981)
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)
Eugster, P.: Uniform proxies for Java. In: Proceedings of Object-oriented programming systems, languages, and applications (2006)
Flatt, M., Krishnamurthi, S., Felleisen, M.: Classes and mixins. In: Proceedings of Principles of Programming Languages (1998)
Futamura, Y.: Partial evaluation of computation process–an approach to a compiler-compiler. Higher-Order and Symbolic Comput. 12(4), 381–391 (1999)
Hirschfeld, R., Costanza, P., Nierstrasz, O.: Context-oriented programming. J. Object Technol. 7(3), 125–151 (2008)
Harrison, W., Ossher, H.: Subject-oriented programming (a critique of pure objects). In: Proceedings of Object-Oriented Programming, Systems, Languages, and Applications (1993)
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)
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)
Kristensen, B.B.: Object-oriented modeling with roles. Springer, London (1996)
Lieberman, H.: Using prototypical objects to implement shared behavior in object oriented systems. In: Proceedings of Object-Oriented Programming, Systems, Languages, and Applications (1986)
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)
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)
Ostermann, K.: Dynamically composable collaborations with delegation layers. In: Proceedings of European Conference on Object-Oriented Programming (2002)
Pascoe, G.A.: Encapsulators: a new software paradigm in smalltalk-80. In: Proceedings of Object-Oriented Programming, Systems, Languages, and Applications (1986)
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)
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)
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)
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)
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
Tanter, É.: Expressive scoping of dynamically-deployed aspects. In: Proceedings of Aspect-Oriented Software Development (2008)
Tanter, É.: Execution levels for aspect-oriented programming. In: Proceedings of Aspect-Oriented Software Development (2010)
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)
Tanter, É., Fabry, J., Douence, R., Noyé, J., Südholt, M.: Expressive scoping of distributed aspects. In: Proceedings Aspect-Oriented Software Development (2009)
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)
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)
Van Cutsem, T., Miller, M.S.: Trustworthy proxies. In: Castagna, G. (ed.) ECOOP 2013. LNCS, vol. 7920, pp. 154–178. Springer, Heidelberg (2013)
von Löwis, M., Denker, M., Nierstrasz, O.: Context-oriented programming: Beyond layers. In: Proceedings of International Conference on Dynamic Languages (2007)
Viega, J., Tutt, B., Behrends, R.: Automated elegation is a viable alternative to multiple inheritance in class based languages. University of Virginia, Charlottesville (1998)
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
Corresponding author
Editor information
Editors and Affiliations
Rights 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)