An Introduction to Context-Oriented Programming with ContextS

  • Robert Hirschfeld
  • Pascal Costanza
  • Michael Haupt
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5235)


Context-oriented Programming, or COP, provides programmers with dedicated abstractions and mechanisms to concisely represent behavioral variations that depend on execution context. By treating context explicitly, and by directly supporting dynamic composition, COP allows programmers to better express software entities that adapt their behavior late-bound at run-time. Our paper illustrates COP constructs, their application, and their implementation by developing a sample scenario, using ContextS in the Squeak/Smalltalk programming environment.


Layer Activation Behavioral Variation Expression Tree Partial Method Execution Context 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Apel S.: The Role of Features and Aspects in Software Development. PhD thesis, Otto-von-Guericke University Magdeburg (March 2007)Google Scholar
  2. 2.
    Batory, D.: Feature-oriented programming and the ahead tool suite. In: Proceedings of the International Conference on Software Engineering 2004 (2004)Google Scholar
  3. 3.
    Batory, D., Rauschmeyer, A.: Scaling step-wise refinement. IEEE Transactions on Software Engineering (June 2004)Google Scholar
  4. 4.
    Daniel, G., Bobrow, L.G., De Michiel, R.P., Gabriel, S.E.: Common lisp object system specification: 1. programmer interface concepts. Lisp and Symbolic Computation 1(3-4), 245–298 (1989)Google Scholar
  5. 5.
    Brant, J., Foote, B., Johnson, R.E., Roberts, D.: Wrappers to the rescue. In: Jul, E. (ed.) ECOOP 1998. LNCS, vol. 1445, pp. 396–417. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  6. 6.
    Costanza, P., Hirschfeld, R.: Language constructs for context-oriented programming — an overview of ContextL. In: Wuyts, R. (ed.) Proceedings of the 2005 Dynamic Languages Symposium, ACM Press, New York (2005)Google Scholar
  7. 7.
    Costanza, P., Hirschfeld, R.: Reflective layer activation in ContextL. In: Proceedings of the Programming for Separation of Concerns (PSC) of the ACM Symposium on Applied Computing (SAC). LNCS. Springer, Heidelberg (2007)Google Scholar
  8. 8.
    Costanza, P., Hirschfeld, R., De Meuter, W.: Efficient layer activation for switching context-dependent behavior. In: Lightfoot, D.E., Szyperski, C.A. (eds.) JMLC 2006. LNCS, vol. 4228. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  9. 9.
    Filman, R.E., Elrad, T., Clarke, S., Akşit, M. (eds.): Aspect-Oriented Software Development. Addison-Wesley, Boston (2005)Google Scholar
  10. 10.
    Filman, R.E., Friedman, D.P.: Aspect-oriented programming is quantification and obliviousness. In Filman et al., [9], pp. 21–35.Google Scholar
  11. 11.
    Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns. Addison-Wesley, Reading (1995)zbMATHGoogle Scholar
  12. 12.
    Goldberg, A., Robson, D.: Smalltalk-80: the language and its implementation. Addison-Wesley Longman Publishing Co., Inc., Boston (1983)zbMATHGoogle Scholar
  13. 13.
    Hirschfeld, R.: AspectS – aspect-oriented programming with Squeak. In: Akşit, M., Mezini, M., Unland, R. (eds.) NODe 2002. LNCS, vol. 2591, pp. 216–232. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  14. 14.
    Hirschfeld, R., Costanza, P., Nierstrasz, O.: Context-oriented programming. Journal of Object Technology (JOT) 7(3), 125–151 (2008)CrossRefGoogle Scholar
  15. 15.
    Ingalls, D., Kaehler, T., Maloney, J., Wallace, S., Kay, A.: Back to the future: the story of squeak, a practical smalltalk written in itself. In: OOPSLA 1997: Proceedings of the 12th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pp. 318–326. ACM Press, New York (1997)CrossRefGoogle Scholar
  16. 16.
    Kiczales, G., Lamping, J., Mendhekar, A., Maeda, C., Lopes, C., Loingtier, J.-M., Irwin, J.: Aspect-oriented programming. In: Akşit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 220–242. Springer, Heidelberg (1997)CrossRefGoogle Scholar
  17. 17.
    Nordberg III, M.E.: Aspect-oriented dependency management. In: Filman et al., [9], pp. 557–584Google Scholar
  18. 18.
    Smith, R.B., Ungar, D.: A simple and unifying approach to subjective objects. TAPOS special issue on Subjectivity in Object-Oriented Systems 2(3), 161–178 (1996)Google Scholar
  19. 19.
    Teitelman, W.: Pilot: A step towards man-computer symbiosis. Technical report, Massachusetts Institute of Technology, Cambridge, MA, USA (1966)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2008

Authors and Affiliations

  • Robert Hirschfeld
    • 1
  • Pascal Costanza
    • 2
  • Michael Haupt
    • 1
  1. 1.Hasso-Plattner-InstitutUniversität PotsdamPotsdamGermany
  2. 2.Programming Technology LabVrije Universiteit BrusselBrusselsBelgium

Personalised recommendations