Popis: |
Scoping behavior adaptations using dynamic extent is a crucial part of Context-oriented Programming (COP). In a synchronous execution model, dynamic extent ensures the activation of a layer for the entire duration of a block. An asynchronous execution model, however, breaks the intended semantics of dynamic extent. For example, using the await keyword postpones the execution of the block and returns to its caller. Thus, dynamic extent deactivates the behavior adaptation. Consequently, when resuming the postponed execution the layer is no longer active.In this paper, we propose a variant of dynamic extent that activates a layer for a block and all its logically-connected asynchronous operations. We show how zones can be used to track the asynchronous dynamic extent of a block. Further, we provide an implementation of our approach as an extension to ContextJS in JavaScript. |