
7 CONCLUSION AND FUTURE
WORK
With the growth of context-awareness using mobile
computing, Context-oriented Programming (COP)
has become important for the development context-
dependent applications. COP provides a module
called layer to encapsulate a set of context dependent
operation to enhance modularity of software systems.
Various COP languages with different features have
been proposed so far, and they have verified the ef-
fectiveness with some applications. However these
applications are sometimes ideal and their scales are
not enough.
In this paper, we evaluate the applicability of COP
through the practical context-aware mobile applica-
tion development that uses ContextJS as a COP ex-
tension of JavaScript and ReactNative as a UI frame-
work. We also apply some software metrics such as
cyclomatic complexity in order to evaluate the COP
effectiveness from the quantity view points. As a
consequence, at least in our implementation, apply-
ing COP does not improve software metrics dras-
tically. We think there are two main reasons: 1)
some of context dependent behaviors where COP can
apply are handled by the framework, meaning that
COP is not necessary, 2) semantic mismatches be-
tween the activation mechanism (i.e., with block)
and asynchronous executions in ReactNative, requir-
ing additional conditional branches to achieve the ex-
pected behaviors. Even though this paper does not
cover all cases that might be happened using COP
and framework in practical software development, we
have shown that activating layers with with block
and component-based framework might have prob-
lems in a practical application development.
As future work, further validation across various
types of mobile applications is necessary to clarify
the correlation between applicability and code qual-
ity. Additionally, it will be important to measure or
propose metrics beyond those presented in this paper
to assess the impact of COP on code, with the goal
of identifying metrics that effectively evaluate COP’s
influence on code quality.
REFERENCES
Angular (2024). Angular. https://angular.io/.
AnnCampbell, G. (2017). Cognitive complexity - a new
way of measuring understandability. Technical Re-
port. SounarSource SA, Switzerland.
Appeltauer, M., Hirschfeld, R., and Lincke, J. (2013).
Declarative layer composition with the jcop pro-
gramming language. Journal of Object Technology,
12(2):4:1–37.
Appeltauer, M., Hirschfeld, R., and Masuhara, H. (2009).
Improving the development of context-dependent java
applications with contextj. In International Workshop
on Context-Oriented Programming, page 5, Genova,
Italy.
Costanza, P. and Hirschfeld, R. (2005). Language
constructs for context-oriented programming: An
overview of contextl. In Proceedings of the 2005
Symposium on Dynamic Languages, pages 1–10, San
Diego, California.
Electron (2024). Electron. https://www.electronjs.org/.
Firebase (2024). Firebase. https://firebase.google.com.
Flutter (2024). Stateful widget. https://flutter.dev/docs/
development/ui/widgets/stateful.
Fukuda, H., Leger, P., and Cardozo, N. (2022). Layer ac-
tivation mechanism for asynchronous executions in
javascript. In Proceedings of the 14th ACM Interna-
tional Workshop on Context-Oriented Programming
and Advanced Modularity, pages 1–8. Association for
Computing Machinery.
Gandodhar, P. S. and Chaware, S. M. (2018). Context aware
computing systems: A survey. In 2018 2nd Interna-
tional Conference on I-SMAC, pages 605–608.
Hirschfeld, R., Costanza, P., and Nierstrasz, O. (2008).
Context-oriented programming. In Journal of Object
Technology, volume 7, pages 125–151.
Lin, Y., Li, M., Yang, C., and Yin, C. (2017). A code quality
metrics model for react-based web applications. In In-
telligent Computing Methodologies, Cham, Switzer-
land: Springer.
MCCABE, T. J. (1976). A complexity measure. IEEE
Transactions on Software Engineering, 2(4).
Native, R. (2024). React native. https://reactnative.dev.
React (2024a). Passing data deeply with context. https:
//react.dev/learn/passing-data-deeply-with-context.
React (2024b). React. https://react.dev.
React (2024c). Writing markup with jsx. https://react.dev/
learn/writing-markup-with-jsx.
Runkeeper (2024). Runkeeper. https://runkeeper.com.
Unity (2024). Unity collider. https://docs.unity3d.com/
Manual/CollidersOverview.html.
Vue (2024). Vue. https://vuejs.org/.
The Impact of Context-Oriented Programming on Declarative UI Design in React
707