Model-Driven Context Management for Self-Adaptive ...

2 downloads 0 Views 2MB Size Report
Abstract. The user interfaces (UIs) of interactive systems become in- creasingly complex since many heterogeneous and dynamically changing context-of-use ...
Model-Driven Context Management for Self-Adaptive User Interfaces Enes Yigitbas, Silas Gr¨ un, Stefan Sauer and Gregor Engels Paderborn University, s-lab - Software Quality Lab, Zukunftsmeile 1, 33102 Paderborn, Germany {enes.yigitbas,gruensil,sauer,engels}@upb.de

Abstract. The user interfaces (UIs) of interactive systems become increasingly complex since many heterogeneous and dynamically changing context-of-use parameters regarding user profile, platform, and usage environment have to be supported. Self-adaptive UIs have been promoted as a solution for context variability due to their ability to automatically adapt to the context-of-use at runtime. Context modeling and context management are important prerequisites for supporting self-adaptive UIs, but introduce additional complexity since context information has to be captured using sensors from heterogeneous sources and dynamic context changes have to be monitored to enable UI adaptation at runtime. To overcome the complex and cumbersome task of context management, we present a model-driven approach for developing a flexible context manager supporting self-adaptive UIs. Our approach consists of a new context modeling language, named ContextML, for specification of various context-of-use situations. Based on the specified context model, our approach enables automatic generation of context services for monitoring context-of-use parameters. The benefit of our approach is demonstrated by a case study, where generated context services provide context information and trigger the adaptation of UIs for a university library web application. Keywords: Model-Driven UI Development, Self-Adaptive UIs, ContextAwareness, Context Management

1

Introduction

Acceptance and usability of a user interface is highly influenced by its contextof-use, which is defined in terms of the user, platform, and environment [1]. As todays user interfaces of interactive systems become increasingly complex since many heterogeneous contexts of use have to be supported, it is no longer sufficient to provide a single one-size-fits-all user interface. Building multiple UIs for the same functionality due to context variability is also difficult since context changes can lead to the combinatorial explosion of the number of possible adaptations and there is a high cost incurred by manually developing multiple versions of the UI [2].

2

Enes Yigitbas, Silas Gr¨ un, Stefan Sauer and Gregor Engels

In recent research, self-adaptive UIs have been promoted as a solution for context variability due to their ability to automatically adapt to the contextof-use at runtime [2]. A key goal behind self-adaptive UIs is plasticity denoting a UI’s ability to preserve its usability despite dynamically changing contextof-use parameters [3]. In our previous work [4], we presented a model-driven development approach for self-adaptive UIs, but special attention is required for context management due to the complexity of capturing context information through various sensors from heterogeneous sources and monitoring dynamically changing context-of-use parameters. In detail, the following challenges have to be addressed to integrate context management aspects into model-driven development of self-adaptive UIs: – C1: Specification of contextual parameters: A modeling language is required for specifying different contexts-of-use. That means, different contextual situations that can occur during usage of the UI should be modeled. With the help of this language, developers should be able to separately specify needed context sensor services that should be included in their customized context manager. – C2: Generation of context sensor services: Based on the specified contextof-use model, code for the required context services need to be generated for monitoring context information and triggering the adaptation at runtime. – C3: Execution of context services and runtime monitoring: For supporting runtime monitoring of dynamic context changes, the generated context services should observe the context sensors and provide context information data. To address the above described challenges, our solution idea is based on the integration of model-driven UI development and adaptation with model-driven context management. Therefore, we introduce a new modeling language, called ContextML, that supports the specification of various context situations. Based on the specified context model, different context services are generated that make use of existing sensor libraries to monitor contextual parameters. We show, how generated context services are integrated in our UI framework for triggering and executing UI adaptations at runtime. The remaining sections of the paper are organized as follows: Section 2 presents our Model-Driven Context Management Framework (MCMF). In Section 3, we present the implementation of our approach. Section 4 shows the benefit and usefulness of our approach based on a case study. Related work is presented in Section 5 and finally Section 6 concludes the paper and gives an outlook on future work.

2

Model-driven Context Management Framework

Our approach, solving the before stated challenges, is a Model-driven Context Management Framework that is depicted in Figure 1. It is sectioned in three development phases. In the following, we will give a brief overview of the whole

Model-Driven Context Management for Self-Adaptive User Interfaces

framework. Technical details regarding modeling and implementation are discussed in the subsequent sections.

1

Modeling

2

Input

Context ML

(XML)

Transformation Context Service Generator

3

Execution

M2T

Context Service

(Xtend)

(Typescript)

Context Providers Affectiva SDK

provides context data

Ambient Light API

Context Controller

populates

Context Profile

context data

...

Fig. 1. Mode-Driven Context Management Framework

The first phase of the framework is the creation of a context model at design time. For this, we introduce the context modeling language ContextML. It allows to define a set of context properties and the needed context provider interfaces to capture the relevant context information. These interfaces are later on referenced as Context Providers. For example, the environmental light condition of our context-of-use can be captured by using a provided Ambient Light API. Also the types of these properties and their behavior, in terms of data updating, has to be defined. In our example, ambient light is monitored as current light-level, and it shall be updated as soon as a change is detected (event-triggered). This model is automatically saved as an XML file for better processability. After finishing the context modeling phase, the context model specified in ContextML serves as an input for the Context Service Generator in the second phase. The latter creates an executable code for the Context Service with a Model-To-Text-Transformation (M2T), based on code fragments in form of Angular1 code. The generator consists of several sub-generators, which are described in detail later on. The last phase comprises the Context Service at runtime, whose components are created in the previous generation step. The before defined providers and the Context Profile are directly derived from the defined model. In the providers we can insert code to access information supported by APIs or libraries for JavaScript. In our case, Ambient Light API2 and Affectiva SDK3 are shown as examples for sensing context information data through sensors. The observed context information is pushed to the Context Controller, which connects the providers with the Context Profile. There, the data is stored and offered to external systems or components, which can use the context information for different purposes like UI self-adaptation. 1 2 3

https://angular.io https://www.w3.org/TR/ambient-light/ https://github.com/Affectiva

3

4

3

Enes Yigitbas, Silas Gr¨ un, Stefan Sauer and Gregor Engels

Implementation

In this section we describe the implementation of our Model-Driven Context Management Framework in detail. 3.1

ContextML

The first challenge addressed in our approach was the specification of contextual parameters. To support a holistic modeling of contextual parameters, we introduce a new modeling language ContextML that is designed conform to the Context Metamodel depicted in Figure 2.

UpdateType -EventTriggered -Slow -Fast

Context

contains 1

1 owns 0..* 0..*

DataType

1..* Composition

ContextProvider

1 1..*

Source

1

0..*

1 Providing

Target 0..*

references

1..* is owned Context Property 1

is owned 1 owns 1

-Integer -String -Boolean -DefType

Context Entity

Update

contains

Enumeration

1 -update : UpdateType

1 1 contains 1 Data 0..* -data : DataType

0..*

references

DefType

0..1

Enum 1 2..*

-name : string

Fig. 2. Context Metamodel

The root element and central class of the metamodel is the class Context that connects all parts of the model. The Context Entities are categories for tracked context data and are further refined by Context Properties, which allow a concrete specification of the triplet User, Platform and Environment. The Context Properties are containers for the concrete context data and connect it with meta information, which is important for the connection of the generated elements. It covers the used data type and the update type. The latter is the way the single data set shall be updated. This can be ”Fast” (every 5 sec), ”Slow” (every 100 sec) or ”EventTriggered”, which is as soon as the context information changes. Moreover, the reference to the desired Context Provider is saved, which is the before mentioned source of context information. The DataType can be a standard type like Integer, String or Boolean, but also a user defined type is supported by a DefType. This is an enumeration, which contains Enums, which include a selection of different states of that type. The metamodel is designed

contains Data Powered ByVisualEnum ParadigmUpdate Community

Model-Driven Context Management for Self-Adaptive User Interfaces

for a broad scope of context modeling aspects and allows adding more entities, properties, data types, and other provider. An example of a context model excerpt specified based on this metamodel is depicted in Figure 3. It shows a set of possible context entities. For illustrating the context modeling language, exemplary entities which contain some exemplary context properties are shown. This model snippet will also be used to demonstrate the generation process. Based on the metamodel, we also created a textual language for ContextML using Xtext4 , which provides an Eclipse plugin. It allows an easy modeling of the context, due to error highlighting and code completion. That way the required programming knowledge and error potential is reduced. An example is displayed on the right side of Figure 3. a)

b)

: Context

Platform : Context Entity

Environment : Context Entity

Mood : Context Property

DeviceType : Context Property

AmbientLight : Context Property

Data = DeviceType Update = EventTriggered

Data = Level Update = EventTriggered

DeviceAPI : ContextProvider

AmbientLightAPI : ContextProvider

Data = Mood Update = Fast AffectivaAPI : ContextProvider

...

User : Context Entity

Fig. 3. Excerpt of a context model in ContextML

After saving the model file an XML file is generated automatically, which serves as an input for the Context Service Generator. 3.2

Context Service Generator

In this section, we describe the process of generating Context Services represented as Angular code in form of Typescript. The generation is based on the XML file of the previously mentioned context model. The structure of the generator for the Context Service is shown in Figure 4. It has a main generator that splits the generation into four kinds of files that will be generated. Our Context Service Generator is a template-based code generator that is implemented with Xtend 5 . First, the ContextServiceGenerator invokes the ContextControllerGenerator which generates the main Angular service that connects and controls all the 4 5

https://eclipse.org/Xtext/ http://www.eclipse.org/xtend/

5

6

Enes Yigitbas, Silas Gr¨ un, Stefan Sauer and Gregor Engels Context Service Generator ContextServiceGenerator Controller

ContextControllerGenerator

Providers

ContextProvidersGenerator

DefTypes ContextTypesGenerator

ContextProfileGenerator

DefType

Provider ContextProviderGenerator

Profile

ContextTypeGenerator

Entity ContextEntityGenerator

Fig. 4. Component Diagram of Context Service Generator

other parts. The generated Context Controller contains subscriptions to subjects, which push changed data automatically to the subscriber based on the rxjs observer pattern 6 . Furthermore, it contains timers for the properties which are The ContextProvidersGenerator invokes the ContextProviderGenerator for each provider that is listed in the context model. This creates a folder with all provider files. Each contains standard imports and used DefTypes. The business logic code for controlling and managing of sensor sources, like APIs or libraries has to be inserted manually. This is due to the very individual structure of numerous interfaces. Those can be fairly easy to use, like standard HTML5 APIs7 , but can be individual and more complex as well, like the Affectiva SDK for emotion recognition. In our case study we have already implemented some exemplary Context Providers. The ContextTypesGenerator invokes similar to the ContextProvidersGenerator the ContextTypeGenerator for each user definded DefType. This creates a folder with type files, that are imported by the providers. Each file contains the Enums defined in the context model. The last generator component is the ContextProfileGenerator that creates a central context data profile file and invokes the ContextEntityGenerator for each declared entity in the context model. This creates a file for each entity which contains all the defined properties and the corresponding getter and setter methods. An example for the generation of a Context Provider is depicted in Figure 5. The code excerpt depicted in Figure 5 a) represents the Xtend template for generating specific context providers to capture context information through sensor libraries. In Figure 5 b) the generated code for the AmbientLight provider is illustrated. The code of the generated context provider is responsible for monitoring the environmental lighting condition at runtime by using the AmbientLightAPI. 6 7

https://github.com/Reactive-Extensions/RxJS https://www.w3.org/2009/dap/

Component

Model-Driven Context Management for Self-Adaptive User Interfaces

7

b)

a)

...

Fig. 5. Xtend template excerpt for ContextProviderGenerator (a) and its generated code (b)

3.3

Context Service

At runtime, the generated Context Service works as a background service, that can be used by any web application based on the Angular framework. A runtime system overview is depicted in Figure 6. Depending on the defined update type of the context properties, the context providers either access the information event-based or triggered by the timer of the Context Controller. Through the subjects of the observer pattern, new data is directly pushed to the subscriptions of the controller. At the same time, the corresponding property is updated in the context profile. Based on the provided context information data through the Context Service, an Adaptation Service is able to dynamically monitor context information and trigger adaptation mechanisms, for instance to adapt a Final UI.

Context Service (Typescript)

Context Providers Affectiva SDK

push data

Ambient Light API

...

Context Controller

updates

Context Profile triggers

provides context data

Adaptation monitors Service adapts

Fig. 6. Communication within the Context Service at runtime

Final UI

...

8

4

Enes Yigitbas, Silas Gr¨ un, Stefan Sauer and Gregor Engels

Case study

For illustrating the benefit of our Model-Driven Context Management Framework, we present a case study where our framework is applied in the context of self-adaptive user interfaces. Based on our framework, we specified a context-ofuse model and generated various context services that support the monitoring of contextual parameters. The observed context information and occurring context changes were provided to the adaptation service of a self-adaptive UI. Based on the provided context information, the adaptation service was able to adapt the UI at runtime, that means it reacted to context-of-use changes by automatically changing layout, navigation or task-feature set of the UI [4]. In the following the case study and the application of our generated context services in the context of self-adaptive UIs is explained in more detail. The case study setting is based on an example scenario which is derived from the university library management domain (see Figure 7). The scenario setting is a library web application for universities which is called ”LibSoft”. LibSoft provides core library management functionality like searching, reserving and lending books. LibSoft’s UI can be accessed by heterogeneous users and user roles (like student or staff member) through a broad range of networked interaction devices (e.g. smartphones, tablets, terminals etc.) which are used in various environmental contexts (e.g. brightness, loudness, while moving etc.). Depending on the situation, users are able to access their library services where, when and how it suits them best. For example, if the user wants to pursue a self-determined cross-channel book lending process, she can begin an interaction using one channel (search and reserve a book with her laptop at home), modify the transaction on her way using a mobile channel, and finalize the book lending process at the university library via self-check-out terminal or at the staff desk. In the described example scenario, each channel has its own special context-of-use and eventually the contextual parameters regarding user, platform and environment can dynamically change. Figure 8 shows such a context-of-use (CoU) change from CoU2 to CoU4 (compare Figure 7). The depicted context-of-use object model excerpts in Figure 8 illustrate how different contextual parameters regarding user, platform and environment can change. Therefore, it is important to continuously monitor the context-of-use parameters and react to possible changes by automatically adapting the UI for the new context-of-use situation. Already a small set of contextual parameters can highly influence the UI since lots of context situations can occur if the context-of-use parameters dynamically change. The generated context services based on our framework were able to continuously monitor the context information data. Furthermore the generated context services were able to detect changes in contextual parameters and notified the adaptation service of the self-adaptive UI to apply adaptation mechanisms. The interplay between the generated context services and the existing adaptation approach resulted in self-adaptive UIs that are aware of their contextof-use. Screenshots of the resulting self-adaptive UI are depicted in Figure 9. According to the monitored context information for CoU2, the layout for the

Model-Driven Context Management for Self-Adaptive User Interfaces

Context-of-use 3 Context-of-use 1 Search Book

Lend Book

Context-of-use 2

Reserve Book

Edit Book Reservation

XOR

XOR

Issue Book

Context-of-use 4 [User, Platform, Environment]

Fig. 7. Example scenario: UIs in dynamically changing context-of-use situations.

e:Environment brightnessLevel = 30

u:User

e:Environment brightnessLevel = 100

environment

name = "Jane Doe" age = 26 language = "en" visionAid = false computerSelfEfficacy = true role = "student" admin = false

CoU2:ContextModel

u:User

environment

CoU4:ContextModel

user

user

platform p:Platform type = "mobile"

Context-of-Use Change

platform

name = "John Roe" age = 50 language = "de" visionAid = false computerSelfEfficacy =false role = "staff" admin = true

p:Platform type = "desktop"

Fig. 8. Context-of-use object model excerpts

UI is optimized for a mobile device used in a darker environment, because the user Jane is editing her book reservation while travelling to the library and it is already quite dark outside (see left side of Figure 9). Also, the UI is adapted to the user properties by enabling access to the functions and navigation available to students. The UI language is set to English as it is preferred by the user Jane. Since Jane is recognized as a self-efficacious user with the application, she gets extended functionalities, like a more complex search and filter mechanism for the list view of the books. When the context changes from CoU2 to CoU4, the generated self-adaptive UI adapts itself automatically to the new contextual parameters. In this case, the staff members view on a desktop device with a wider and brighter layout is shown, displaying the list of reserved books, because in CoU4 a staff member, John Roe, uses his desktop computer to issue the book to Jane. Additionally, to the functionalities and functions available to staff members, John is provided with a link to the administration interface, because he is granted access to the administration interface. The UI Language is set to German and the search and filter mechanisms of the list are simplified, because he just started using LibSoft and is, therefore, not yet self-efficacious. Since the location is a well-lit library, the brightness of the environment is high. The case study demonstrates the benefit of our approach and showcases our solution approach for addressing the introduced challenges C1-C3. Through

9

10

Enes Yigitbas, Silas Gr¨ un, Stefan Sauer and Gregor Engels

UI for CoU4:

UI for CoU2:

Change of Context-of-use

Fig. 9. UI adaptation according to different contexts-of-use

the separate specification of context models, relevant context services that are needed for monitoring context information are generated in a comfortable and automated way. The case study also shows how generated context services can be coupled with adaptation services for example to realize self-adaptive UIs. Beside that, it is conceivable that our framework and generated context services can be also applied for other adaptation purposes in other domains.

5

Related Work

Various approaches in the area of context-aware computing were presented in the past years. We briefly present a selection of works that focus on context-aware applications based on models. An important architecture for building context-aware applications was already presented by Dey et al. [5]. They developed a context toolkit that enables rapid prototyping of context-aware applications. The architecture of their context toolkit consists of sensors to collect context information, widgets to encapsulate the contextual information and provide methods to access the information, as well as interpreters to transform the context information into high-level formats that are easier to handle. Beside this approach, various other frameworks like WildCAT or JCAF were introduced to support the development of contextaware applications. Both, WildCAT [6] and JCAF [7] are frameworks based on the programming language Java and they support context management by allowing the definition of a dynamic data model to represent the execution context for several application domains. In addition, they offer a programming interface to discover, interpret and monitor the events occurring in an execution context and record every change occurring in the context model. Similar to these frameworks, Costa [8] presents an architecture based on the Event-Control-Action paradigm that is composed of three components: context processor, controller and action performer. The context processor component captures context information from

Model-Driven Context Management for Self-Adaptive User Interfaces

the user’s environment, performs context reasoning and generates context and situation events. The controller component observes events from context processors, monitors condition rules and triggers actions on action performer when the condition is satisfied. A systematic and methodological approach for developing context-aware systems is presented in [9]. In this paper, the authors present a model-based approach that addresses the development of context-aware applications from both the theoretical and practical perspectives. While before mentioned approaches consider context management for a broad spectrum of applications areas, there are also specific approaches that deal with context management and context modeling specifically for supporting the adaptation of user interfaces of interactive systems. One holistic approach in this direction is the conceptual framework named TriPlet [10]. TriPlet contains a Context-Aware Meta-Model (CAM), that defines concepts required to implement and run a context-aware user interface. Context modeling and contextawareness related approaches were also applied in the mobile context. In [11] for example, the authors present a sensor-driven software framework for rapid prototyping of mobile applications. Closely related to our work is also the approach [12], where the authors deal with the topic of context-aware self-adaptation. They present a model-driven engineering approach to generate context-aware self-adaptation mechanisms. Our approach relies on and extends existing modeldriven context management approaches by supporting the automatic generation of context services to monitor and detect context information changes. Although we showed the feasibility and usefulness of our context services in the context of self-adaptive UIs, it is possible to extend our framework through new sensor sources and context entities and therefore conceivable to apply it in various other application scenarios.

6

Conclusion and Outlook

In this paper, we present a model-driven context management framework. The framework consists of a novel context modeling language, named ContextML, that supports modeling of various context-of-use situations. Based on the specified context model, our framework enables the automatic generation of context services for monitoring context-of-use parameters at runtime. The benefit of our approach is illustrated based on a case study where generated context services are applied in the context of self-adaptive UIs. The case study shows how generated context services can be coupled with an adaptation service to provide context information data and trigger adaptation mechanisms at runtime. This allows runtime UI adaptation realized by an automatic reaction to dynamically changing context-of-use parameters like user profile, platform, and usage environment. In ongoing research, we investigate how additional context information properties can be automatically monitored and captured by context sensors to be used for further adaptation scenarios. Further research will also cover the application of our framework for other adaptation purposes in other domains.

11

12

Enes Yigitbas, Silas Gr¨ un, Stefan Sauer and Gregor Engels

Acknowledgement This work is based on ”KoMoS”, a project of the ”it’s OWL” Leading-Edge Cluster, partially funded by the German Federal Ministry of Education and Research (BMBF).

References 1. G. Calvary, J. Coutaz, D. Thevenin, Q. Limbourg, L. Bouillon, and J. Vanderdonckt. 2003. A Unifying Reference Framework for Multi-Target User Interfaces. Interacting with Computers, 15, 289-308. 2. P. A. Akiki, A. K. Bandara, and Y. Yu, Adaptive Model-Driven User Interface Development Systems. 2014. ACM Comput. Surv., vol. 47, no. 1, pp. 64:1-64:33. 3. J. Coutaz. 2010. User Interface Plasticity: Model Driven Engineering to the Limit! In Proceedings of the 2nd ACM SIGCHI Symposium on Engineering Interactive Computing Systems. ACM, 1-8. 4. E. Yigitbas, H. Stahl, S. Sauer, and G. Engels: Self-Adaptive UIs: Integrated Model-Driven Development of UIs and their Adaptations. In Proceedings of the 13th European Conference on Modelling Foundations and Applications (ECMFA’17). Springer, LNCS (2017) (to appear)https://cs.uni-paderborn. de/fileadmin/informatik/fg/dbis/Publikationen/2017/ECMFA.pdf 5. A. K. Dey, G. D. Abowd, and D. Salber. 2001. A conceptual framework and a toolkit for supporting the rapid prototyping of context-aware applications. Hum.-Comput. Interact. 16, 2 (December 2001), 97-166. 6. P.-C. David and T. Ledoux. 2005. WildCAT: a generic framework for context-aware applications. In Proceedings of the 3rd international workshop on Middleware for pervasive and ad-hoc computing (MPAC ’05). ACM, New York, NY, USA, 1-7. 7. J. E. Bardram. 2005. The java context awareness framework (JCAF) a service infrastructure and programming framework for context-aware applications. In Proceedings of the Third international conference on Pervasive Computing (PERVASIVE’05), Hans-W. Gellersen, Roy Want, and Albrecht Schmidt (Eds.). SpringerVerlag, Berlin, Heidelberg, 98-115. 8. P.D. Costa. 2007. Architectural support for context-aware applications: from context models to services platforms. Ph.D. Thesis, University of Twente. 9. I. Jaouadi, R. Ben Djemaa, and H. Ben-Abdallah. 2016. A model-driven development approach for context-aware systems. Software and Systems Modeling. 10. V.G. Motti and J. Vanderdonckt. 2013. A computational framework for contextaware adaptation of user interfaces. IEEE Seventh International Conference on Research Challenges in Information Science (RCIS), pp. 1-12. 11. B. Gamecho, L. Gardeazabal, J. Abascal. 2016. A Sensor-Driven Framework for Rapid Prototyping of Mobile Applications Using a Context-Aware Approach. In: Garca C., Caballero-Gil P., Burmester M., Quesada-Arencibia A. (eds) Ubiquitous Computing and Ambient Intelligence. UCAmI 2016. LNCS, vol 10069. Springer. 12. T. Ruiz-L´ opez, C. Rodr´ıguez-Dom´ınguez, M.J. Rodr´ıguez, S.F. Ochoa, J.L. Garrido. 2013. Context-Aware Self-adaptations: From Requirements Specification to Code Generation. In: Urzaiz G., Ochoa S.F., Bravo J., Chen L.L., Oliveira J. (eds) Ubiquitous Computing and Ambient Intelligence. Context-Awareness and ContextDriven Interaction. UCAmI 2013. LNCS, vol 8276, Springer.

Suggest Documents