Abstract
Today’s programming platforms do not provide sufficient constructs that allow a program’s behavior to depend on the context in which it is executing. This paper presents the design and implementation of programming language extensions that explicitly support our vision of Context-oriented Programming. In this model, programs can be partitioned into layers that can be dynamically activated and deactivated depending on their execution context. Layers are sets of partial program definitions that can be composed in any order. Context-oriented Programming encourages rich, dynamic modifications of program behavior at runtime, requiring an efficient implementation. We present a dynamic representation of layers that yields competitive performance characteristics for both layer activation/deactivation and overall program execution. We illustrate the performance of our implementation by providing an alternative solution for one of the prominent examples of aspect-oriented programming.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Avgustinov, P., Tibble, J., Christensen, A.S., Hendren, L., Kuzins, S., Lhotak, J., Lhotak, O., de Moor, O., Sereni, D., Sittampalam, G.: Optimizing AspectJ. In: Proceedings of the 2005 ACM SIGPLAN conference on Programming Language Design and Implementation (2005)
Barrett, K., Cassels, B., Haahr, P., Moon, D.A., Playford, K., Withington, P.T.: A Monotonic Superclass Linearization for Dylan. In: OOPSLA 1996, Proceedings (1996)
Bobrow, D., Goldstein, I.: Representing Design Alternatives. In: Proceedings of the Conference on Artificial Intelligence and the Simulation of Behavior, Amsterdam (July 1980)
Bobrow, D., DeMichiel, L., Gabriel, R., Keene, S., Kiczales, G., Moon, D.: Common Lisp Object System Specification. Lisp and Symbolic Computation 1(3-4), 245–394 (1989)
Bockisch, C., Dinkelaker, T., Haupt, M., Krebs, M.: The Steamloom Manual (December 2004), Available: http://www.st.informatik.tu-darmstadt.de/static/pages/projects/AORTA/Steamloom.jsp
Bockisch, C., Haupt, M., Mezini, M., Ostermann, K.: Virtual Machine Support for Dynamic Join Points. In: AOSD 2004, Proceedings. ACM Press, New York (2004)
Bockisch, C., Kanthak, S., Haupt, M., Arnold, M., Mezini, M.: Efficient Control Flow Quantification. In: OOPSLA 2006, Proceedings. ACM Press, New York (2006)
Brichau, J., De Meuter, W., De Volder, K.: Jumping Aspects. In: ECOOP 2000 International Workshop on Aspects and Dimensions of Concerns (2000)
Büchi, M., Weck, W.: Generic Wrappers. In: Bertino, E. (ed.) ECOOP 2000. LNCS, vol. 1850, p. 201. Springer, Heidelberg (2000)
Chambers, C., Chen, W.: Efficient Multiple and Predicate Dispatching. In: OOPSLA 1999, Proceedings (1999)
Chan, P.: The Java Developers Almanac 1.4, Volume 1: Examples and Quick Reference. Addison-Wesley Professional, Reading (2002)
Chen, G., Kotz, D.: A Survey of Context-Aware Mobile Computing Research. Technical Report TR2000-381, Dept. of Computer Science, Dartmouth College, Hanover, USA (November 2000)
Clifton, C., Millstein, T., Leavens, G.T., Chambers, C.: MultiJava: Design Rationale, Compiler Implementation, and Applications. ACM Transactions on Programming Languages and Systems (TOPLAS) 28(3), 517–575 (2006)
Costanza, P., Kniesel, G., Cremers, A.: Lava – Spracherweiterungen für Delegation in Java. In: JIT 1999 – Java-Informations-Tage 1999, Springer, Informatik Aktuell (1999)
Costanza, P.: Dynamically Scoped Functions as the Essence of AOP. In: ECOOP 2003 Workshop on Object-oriented Language Engineering for the Post-Java Era, Darmstadt, Germany, July 22, 2003; ACM Sigplan Notices, 38(8) (August 2003)
Costanza, P.: A Short Overview of AspectL. In: European Interactive Workshop on Aspects in Software (EIWAS 2004) Berlin, Germany, September 23–24 (2004)
Costanza, P.: How to Make Lisp More Special. In: Proceedings of International Lisp Conference, Stanford (2005)
Costanza, P., Hirschfeld, R.: Language Constructs for Context-oriented Programming. In: Proceedings of ACM Dynamic Languages Symposium, San Diego, USA (2005)
Dufour, B., Goard, C., Hendren, L., de Moor, O., Sittampalam, G., Verbrugge, C.: Measuring the dynamic behavior of AspectJ programs. In: Proceedings of OOPSLA 2004. ACM Press, New York (2004)
Forman, I.R., Forman, N.: Java Reflection in Action. Manning Publications Co. (2004)
Fugetta, A., Picco, G.P., Vigna, G.: Understanding Code Mobility. IEEE Transactions on Software Engineering 24(5) (May 1998)
Gassanenko, M.: Context-oriented Programming: Evolution of Vocabularies. In: Proceedings of the euroFORTH 1993 Conference. Marianske Lazne, Czech Republic (1993)
Gassenenko, M.: Context-oriented Programming. In: euroFORTH 1998, Schloss Dagstuhl, Germany (1998)
Gelernter, D., Jagannathan, S., London, T.: Environments as First Class Objects. In: POPL 1987, Proceedings (1987)
Hauswirth, M., Sweeney, P.F., Diwan, A., Hind, M.: Vertical Profiling: Understanding the Behavior of Object-Oriented Applications. In: OOPSLA 2004, Proceedings (2004)
Hirschfeld, R.: AspectS - Aspect-Oriented Programming with Squeak. In: Aksit, M., Mezini, M., Unland, R. (eds.) NODe 2002. LNCS, vol. 2591, pp. 216–232. Springer, Heidelberg (2003)
Hirschfeld, R., Costanza, P.: Extending Advice Activation in AspectS. In: European Interactive Workshop on Aspects in Software (EIWAS 2005), Brussels, Belgium (2005)
Hölzle, U.: Personal communication (1999)
Keays, R., Rakotonirainy, A.: Context-oriented Programming. In: International Workshop on Data Engineering for Wireless and Mobile Access, San Diego, USA. ACM Press, New York (2003)
Kiczales, G., Rodriguez, L.: Efficient method dispatch in PCL. In: Proceedings of the 1990 ACM conference on LISP and Functionl Programming (1990)
Kiczales, G., Hilsdale, E., Hugunin, J., Kersten, M., Palm, J., Griswold, W.G.: An Overview of AspectJ. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, p. 327. Springer, Heidelberg (2001)
Kniesel, G.: Type-Safe Delegation for Run-Time Component Adaptation. In: Guerraoui, R. (ed.) ECOOP 1999. LNCS, vol. 1628. Springer, Heidelberg (1999)
Lieberman, H.: Using Prototypical Objects to Implement Shared Behavior in Object-oriented Systems. In: OOPSLA 1986, Proceedings (1986)
Mezini, M., Ostermann, K.: Conquering Aspects with Caesar. In: 2nd International Conference on Aspect-Oriented Software Development (AOSD 2003), Boston, USA, March 17-21, 2003, pp. 90–100. ACM Press, New York (2003)
Mohnen, M.: Interfaces with Default Implementations in Java (extended abstract). In: Proceedings of Conference on the Principles and Practice of Programming in Java, Dublin, Ireland (June 2002)
Moors, A., Smans, J., Truyen, E., Piessens, F., Joosen, W.: Safe language support for feature composition through feature-based dispatch. In: Position paper at 2nd Workshop on Managing Variabilities Consistently in Design and Code (MVCDC 2005), OOPSLA 2005, San Diego, California, USA, October 20 (2005)
Nierstrasz, O., Ducasse, S., Reichhart, S., Schärli, N.: Adding Traits to (Statically Typed) Languages. Technical report no. IAM-05-006, Institut für Informatik, Universität Bern, Switzerland (December 2005)
Ostermann, K.: Dynamically Composable Collaborations with Delegation Layers. In: Magnusson, B. (ed.) ECOOP 2002. LNCS, vol. 2374, p. 89. Springer, Heidelberg (2002)
Salzman, L., Aldrich, J.: Prototypes with Multiple Dispatch: An Expressive and Dynamic Object Model. In: Black, A.P. (ed.) ECOOP 2005. LNCS, vol. 3586, pp. 312–336. Springer, Heidelberg (2005)
Smith, R., Ungar, D.: A Simple and Unifying Approach to Subjective Objects. Theory and Practice of Object Systems 2(3) (1996)
Steele, G.L.: Common Lisp the Language, 2nd edn. Digital Press (1990)
Tarr, P., D’Hondt, M., Bergmans, L., Lopes, C.V.: Worshop an Aspects and Dimensions of Concerns: Requirements on, and Challenge Problems For, Advanced Separation of Concerns. In: Malenfant, J., Moisan, S., Moreira, A.M.D. (eds.) ECOOP 2000 Workshops. LNCS, vol. 1964, p. 203. Springer, Heidelberg (2000)
Truyen, E., Vanhaute, B., Joosen, W., Verbaeten, P., Jorgensen, B.N.: Dynamic and Selective Combination of Extensions in Component-Based Applications. In: Proceeedings of the 23rd International Conference on Software Engineering, Toronto, Ontario, Canada, May 12-19, 2001, pp. 233–242 (2001)
Ungar, D., Smith, R.: Self: The Power of Simplicity. In: OOPSLA 1987, Proceedings (1987)
Veit, M., Herrman, S.: Model-View-Controller and ObjectTeams: A Perfect Match of Paradigms. In: 2nd International Conference on Aspect-Oriented Software Development (AOSD 2003), Boston, USA, March 17-21, 2003, pp. 90–100. ACM Press, New York (2003)
Wulf, V., Golombek, B.: Exploration Environments: Concept and Empirical Evaluation. In: Proceedings of GROUP 2001. ACM 2001 International Conference on Supporting Group Work, Boulder, Colorado, USA, September 30 - October 3, 2001. ACM Press, New York (2001)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2006 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Costanza, P., Hirschfeld, R., De Meuter, W. (2006). Efficient Layer Activation for Switching Context-Dependent Behavior. In: Lightfoot, D.E., Szyperski, C. (eds) Modular Programming Languages. JMLC 2006. Lecture Notes in Computer Science, vol 4228. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11860990_7
Download citation
DOI: https://doi.org/10.1007/11860990_7
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-40927-4
Online ISBN: 978-3-540-40928-1
eBook Packages: Computer ScienceComputer Science (R0)