Abstract

Program behavior that relies on contextual information, such as physical location or network accessibility, is common in today's appli- cations, yet its representation at the source code level is not suciently supported by programming languages. With context-oriented program- ming (COP), context-dependent behavior can be explicitly modularized and dynamically activated. The available COP implementations oer lan- guage constructs that allow to describe context-dependent functionality and to specify for which control flows this functionality should be exe- cuted. Since these language constructs require modifications to the source code, the contemporary approaches limit the use of COP to program parts whose source code is accessible to the developer (the user code). The dy- namic control over context-dependent behavior in frameworks cannot be directly addressed by COP as this would imply changes to the source code. Instead, context-dependent behavior is addressed whenever a control flow from the framework code enters the user code. Context composition must be addressed at any of these control flow entry points, which may lead to a redundant specification of this functionality. As a result, dynamic control over layers emerges as a crosscutting concern that obstructs the separation of concerns. In this article, we discuss crosscutting layer composition in framework- based applications in detail. Moreover, we discuss limitations for the ex- pression of semantic relationships of layers that might lead to code du- plication. We present a framework-based application, a simple action ad- venture game that we implemented using a conventional COP language. Along this example, we show how our JCop language supports the decla- ration of layer composition and expression of layer relationships.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call