A library-based approach to context-dependent computation with reactive values: suppressing reactions of context-dependent functions using dynamic binding

Hiroaki Inoue, Atsushi Igarashi · 2016

Language constructs for programming context-dependent computation are required in recent software development, where context information influences program behavior, whose description is often scattered around several modules as conditional expressions. The Context-Oriented Programming (COP) community has revealed that context-dependent computations should be modularized into partially defined methods, those partial methods should be adaptable at run-time, and a method dispatching mechanism should take context information into account. Such language constructs enhance modularity of a program. Although contexts are usually reactively changeable, many existing COP approaches do not consider the relation between contexts and reactive information. In this paper, we develop a Scala library for context-dependent computations, based on the idea of contexts as reactive values, which are well studied in the field of Functional Reactive Programming. We also show that dynamic binding is useful to control how reactive values influence context dependent functions; it provides context caching to prevent unexpected reactions.

Read the paper · More papers on PaperTik