Context-oriented Programming

被引:170
作者
Hirschfeld, Robert [1 ]
Costanza, Pascal [2 ]
Nierstrasz, Oscar [3 ]
机构
[1] Univ Potsdam, Hasso Plattner Inst, Potsdam, Germany
[2] Vrije Univ Brussel, Programming Technol Lab, Brussels, Belgium
[3] Univ Bern, Software Composit Grp, Bern, Switzerland
来源
JOURNAL OF OBJECT TECHNOLOGY | 2008年 / 7卷 / 03期
关键词
D O I
10.5381/jot.2008.7.3.a4
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Context-dependent behavior is becoming increasingly important for a wide range of application domains, from pervasive computing to common business applications. Unfortunately, mainstream programming languages do not provide mechanisms that enable software entities to adapt their behavior dynamically to the current execution context. This leads developers to adopt convoluted designs to achieve the necessary runtime flexibility. We propose a new programming technique called Context-oriented Programming (COP) which addresses this problem. COP treats context explicitly, and provides mechanisms to dynamically adapt behavior in reaction to changes in context, even after system deployment at runtime. In this paper we lay the foundations of COP, show how dynamic layer activation enables multi-dimensional dispatch, illustrate the application of COP by examples in several language extensions, and demonstrate that COP is largely independent of other commitments to programming style.
引用
收藏
页码:125 / 151
页数:27
相关论文
共 44 条
  • [1] Achermann F, 2001, LECT NOTES COMPUT SC, V1897, P77
  • [2] ACHERMANN F, 2001, FORMAL METHODS DISTR, P403
  • [3] AKSIT M, 2003, P 2 INT C ASP OR SOF
  • [4] Apel S., 2006, P INT C SOFTW ENG 20
  • [5] AVGUSTINOV P, 2005, PLDI 05
  • [6] Batory D., 2004, P INT C SOFTW ENG 20
  • [7] Batory D., 2004, IEEE T SOFTWARE ENG
  • [8] Bobrow DG, 1980, P C ART INT SIM BEH
  • [9] Bockisch C., 2006, OOPSLA 2006 P
  • [10] BOCKISCH C, 2004, P 3 INT C ASP OR SOF, P83, DOI DOI 10.1145/976270.976282