|
\renewcommand{\raggedright}{\leftskip=0pt \rightskip=0pt plus 0cm}\raggedrightModern applications tend to increasingly suffer from unpredicted context changes that may occur at any moment during the program execution, so it is urgently needed to adapt their behaviors to such frequently changing contexts dynamically. From the perspective of language-level, language extension is an efficient and prompt approach to conduct those adaptable applications. However, the existing context-based languages can only provide anticipated adaptation which is usually predefined at the initial design time, and they also lack appropriate programming language abstractions of dynamic flavor to support context uncertainty at runtime. In this paper, we present a novel programming language called \emph{GranuleJ}, which enables implicit context checks to be aware of the adaptation of the program and carry out program evolution when the program is no longer satisfied with the current context. GranuleJ introduces \emph{context variable} to identify context changes clearly, \emph{fitness tests} to detect the adaptation points where unsuitable program behaviors happen relying on context variables and \emph{granules} that modularize behavior variations as reuse building blocks to be freely assembled or disassembled at runtime. We have already implemented the language framework of GranuleJ and validated the feasibility and effectiveness of it through performance evaluation. |
|
Keywords:programming language; granule oriented programming; fitness test; dynamic adaptation; context variable; similar granule substitution |
|