Abstract:
Different activation mechanisms for Context-Oriented Programming (COP) like implicit activations have been proposed, increasing COP opportunities to be applied in real scenarios. However, activation mechanisms and base code definitions are insufficiently decoupled, as conditionals to activate layers require base code variable references. This hinders reuse, evolution, and modular reasoning of COP and base code, and therefore, uses of COP in real scenarios. This paper proposes interfaces, which are shared abstractions to communicate activation mechanisms and base code in a decoupled manner. Using these interfaces, an object can exhibit its internal state and behaviors, and conditionals use them to (de)activate layers. As layers are planned to be (re)used in different applications, developers can use interfaces to overcome the incompatibility between values exposed by a particular base code and values required by a layer. In addition, as a layer is a plain object, it can use an interface to exhibit the conditional evaluation of its activation to other layers to resolve conflicts among activations of layers. We apply this proposal to implicit activations in which evaluations of conditionals implicitly (de)activate layers. Finally, we illustrate the benefits of this proposal through RI-JS, a practical JavaScript library that currently supports interfaces, reactive activations (implementation variant for implicit activations), global and dynamic deployment, enter and exit transition processes, and partial methods.
Reference:
Interfaces for Modular Reasoning in Context-Oriented Programming (Paul Leger, Hidehiko Masuhara and Ismael Figueroa), In Proceedings of the 12th International Workshop on Context-Oriented Programming and Advanced Modularity (COP 2020), 2020.
Bibtex Entry:
@inproceedings{leger2020cop,
author = {Paul Leger and Hidehiko Masuhara and Ismael Figueroa},
title = {Interfaces for Modular Reasoning in Context-Oriented Programming},
booktitle = {Proceedings of the 12th International Workshop on Context-Oriented Programming and Advanced Modularity (COP 2020)},
year = 2020,
optvolume = {.},
optnumber = {.},
optpages = {Article No.3},
doi = {10.1145/3422584.3423152},
pdf = {cop2020.pdf},
month = jul,
date = {2020-07-21},
url = {https://2020.ecoop.org/home/COP-2020},
abstract = {Different activation mechanisms for Context-Oriented Programming (COP) like implicit activations have been proposed, increasing COP opportunities to be applied in real scenarios. However, activation mechanisms and base code definitions are insufficiently decoupled, as conditionals to activate layers require base code variable references. This hinders reuse, evolution, and modular reasoning of COP and base code, and therefore, uses of COP in real scenarios. This paper proposes interfaces, which are shared abstractions to communicate activation mechanisms and base code in a decoupled manner. Using these interfaces, an object can exhibit its internal state and behaviors, and conditionals use them to (de)activate layers. As layers are planned to be (re)used in different applications, developers can use interfaces to overcome the incompatibility between values exposed by a particular base code and values required by a layer. In addition, as a layer is a plain object, it can use an interface to exhibit the conditional evaluation of its activation to other layers to resolve conflicts among activations of layers. We apply this proposal to implicit activations in which evaluations of conditionals implicitly (de)activate layers. Finally, we illustrate the benefits of this proposal through RI-JS, a practical JavaScript library that currently supports interfaces, reactive activations (implementation variant for implicit activations), global and dynamic deployment, enter and exit transition processes, and partial methods.}
}