Font Size: a A A

Research And Implementation Of An Extended JCOP Language

Posted on:2016-01-06Degree:MasterType:Thesis
Country:ChinaCandidate:J L JiangFull Text:PDF
GTID:2308330461456526Subject:Computer software and theory
Abstract/Summary:PDF Full Text Request
With the application and popularization of mobile smart devices and embedded con-trollers, development and design of context-awareness software becomes an increas-ingly urgent demand. Context-oriented programming(COP) paradigm is proposed a-gainst this background. Afterwards programming languages that support COP paradig-m has been emerging. JCOP language is one of the typical languages that support COP. It has played an important role in the practice of COP paradigm. However, JCOP lan-guages still has the following main issues:1) lack of support for combined definition of behavior variants which makes it d-ifficult to characterize high-level behavior changes by the combination of some low-level behavior changes.2) duplicated weaving of behavior variants when several behavior variants combine and activate, which results in an unpredictable application logic error.So in this thesis, from the perspective of COP model we proposed an extended COP model, which supports combined definition of behavior variants, and implement-ed an extended JCOP language. On the other hand, we proposed an approach that properly injects monitor statements based on call graph, to avoid duplicated weaving problem when behavior variants combine and activate. Main contribution is summa-rized as follows:1) Based on existing COP model, we introduced the concept of composite layer and corresponding semantics of activation and deactivation of composite layer. By composite layer, it is convenient to describe high-level behavior variants consti-tuted by low-level behavior variants.2) We implemented an extended JCOP language which supports composite layer. We extended JCOP language in language constructs and runtime environment, adding new syntax to define composite layer and implementing a corresponding compiler based on JastAdd. Furthermore, we also implements the mechanism to support runtime activation and deactivation of composite layer.3) We proposed an solution to avoid duplicated weaving of behavior variants when several behavior variants combine and activate. Based on abstract syntax tree we detect call relationship between functions, so that we can estimate whether there is call relationship between two behavior variants’ corresponding base methods. And by inserting monitor statements into right place, our solution could avoid duplicated weaving effectively.4) With improved JCOP language, we implement a prototype system of Lego train control, which shows the effectiveness and correctness of above methods and techniques.
Keywords/Search Tags:COP, JCOE behavior variation, composite layer
PDF Full Text Request
Related items