Abstract
Context-oriented Programming (COP) has been proposed as a new promising paradigm for programming context-aware applications in pervasive environments. However, the expressive power of the layer abstraction in current COP extensions is limited, as layers are only suitable for expressing context with boolean or nominal values and lack support for describing temporal property of context. Besides, partial methods of COP are defined only on top of each single layer but not on a combination of layers, and the behavior of an invoked method is unpredictable as it is determined by the layer activation order. In this paper, we enriches COP by replacing layers with well-structured context entries. Each context entry specifies a piece of context information as well as its temporal property, and a context is represented as a set of many context entries. Many new operations are introduced to manipulate context more conveniently. Furthermore, partial methods are now defined on the notion of situation which is expressed as a combination of multiple context entries, and the evaluation order of multiple active partial methods can be explicitly specified so that the behavior of an invoked method becomes predictable. An implementation on top of ContextJ* and experiments for evaluating it in term of time overhead are also presented in this paper.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Dey, A.K.: Understanding and using context. Personal Ubiquitous Computing 5, 4–7 (2001)
Schmidt, A.: Ubiquitous Computing - Computing in Context. PhD thesis, Lancaster University (2003)
Hirschfeld, R., Costanza, P., Nierstrasz, O.: Context-oriented programming. Journal of Object Technology 7, 125–151 (2008)
Stevens, S.S.: On the theory of scales of measurement. Science 103, 677–680 (1946)
Desmet, B., Vallejos, J., Costanza, P.: Layered design approach for context-aware systems. In: 1st VaMoS 2007 (2007)
Appeltauer, M., Hirschfeld, R., Haupt, M., Masuhara, H.: Contextj: Context-oriented programming with java. Information and Media Technologies 6, 399–419 (2011)
Appeltauer, M., Hirschfeld, R., Masuhara, H., Haupt, M., Kawauchi, K.: Event-Specific Software Composition in Context-Oriented Programming. In: Baudry, B., Wohlstadter, E. (eds.) SC 2010. LNCS, vol. 6144, pp. 50–65. Springer, Heidelberg (2010)
Appeltauer, M., Hirschfeld, R., Haupt, M., Lincke, J., Perscheid, M.: A comparison of context-oriented programming languages. In: International Workshop on Context-Oriented Programming, COP 2009, pp. 6:1–6:6. ACM, New York (2009)
Wan, K., Alagar, V.S., Paquet, J.: Lucx: Lucid enriched with context. In: PLC, pp. 48–56 (2005)
Tong, X., Paquet, J., Mokhov, S.A.: Complete context calculus design and implementation in gipsy. CoRR abs/1002.4392 (2010)
Kamina, T., Aotani, T., Masuhara, H.: Eventcj: a context-oriented programming language with declarative event-based context transition. In: Proceedings of the Tenth International Conference on Aspect-Oriented Software Development, AOSD 2011, pp. 253–264. ACM, New York (2011)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2013 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Ma, J., Tao, X., Zheng, T., Lu, J. (2013). Enriching Context-Oriented Programming with Structured Context Representation. In: Zu, Q., Hu, B., Elçi, A. (eds) Pervasive Computing and the Networked World. ICPCA/SWS 2012. Lecture Notes in Computer Science, vol 7719. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-37015-1_31
Download citation
DOI: https://doi.org/10.1007/978-3-642-37015-1_31
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-37014-4
Online ISBN: 978-3-642-37015-1
eBook Packages: Computer ScienceComputer Science (R0)