Adding context -awareness capabilities to modern mobile and pervasive computing applications (apps) is becoming a mainstream activity in the software engineering community. In this respect, many context models and middleware architectures have been proposed with the aim to provide the developers with tools and abstractions that make it easier to produce context-aware applications. However, current solutions suffer from relatively low reusability and lack ease-of-use. In this paper, we propose a two-layer approach based on model-driven development: At the higher layer, we introduce the design of reusable context plug-ins, which can be used to monitor low-level context data and to infer higher-level information about the users, their computing infrastructure, and their interaction. At the lower layer, the plug-ins themselves are synthesized using more elementary, reusable components. We argue that this development approach provides significant advantages to the developers, as it enables them to design, implement, reuse, and maintain the codebase of context-aware apps more efficiently.To evaluate this approach, we demonstrate it in the context of a two-part example application and assess it both qualitatively and quantitatively.
KEYWORDScode generation, context awareness, MDD, middleware, plug-in, reusability
INTRODUCTIONContext awareness is one of the most sought-after features for modern mobile and pervasive computing applications. Understanding and using context allows applications to identify and predict intention, thus allowing for better and richer human-computer interaction.Researchers have proposed various approaches to ease the task of designing and implementing applications that are context-aware and self-adaptive. At their core, many of these build on reusable code, ranging from the early works of Dey 1 to more recent, plug-in-based architectures such as those described in the previous studies. 2-5 These approaches are designed to allow the applications, which are using them to inquire and access arbitrary context data types. In this respect, the context-awareness and context-inferring parts are separated from the functional logic of the applications by means of reusable context plug-ins (ie, individually deployable units, which provide mechanisms for collecting and processing context data, and inferring higher-level context information). At the same time, many context models and middleware architectures were proposed and documented in the literature. 6,7 Software reuse is at the core of many of those approaches. At a higher level, reuse covers all software engineering phases and ''can be supported by different types of methods, including ad hoc, opportunistic, adaptive, systematic, black-box, whitebox, etc.'' 8 A common drawback in these approaches is that the developers are required to invest a significant amount of time to develop customized components, which are used for collecting, processing, inferring, storing, querying, and accessing context data. Moreover, the developed components are then harder...