A Self-Adaptation of Software Component Structures in Ubiquitous Environments Gautier Bastide Ecole des Mines de Douai 941 rue Charles Bourseul 59508 Douai, France bastide@ensm-douai.fr Abdelhak Seriai Ecole des Mines de Douai 941 rue Charles Bourseul 59508 Douai, France seriai@ensm-douai.fr Mourad Oussalah LINA, Université de Nantes 2 rue de la Houssinière 44322 Nantes, France oussalah@univ-nantes.fr ABSTRACT The creation of applications able to be executed in ubiq- uitous environments, involves a better consideration of the execution context in order to ensure service continuity. In component-based software engineering, applications are built by assembling existing components. For deploying such ap- plications in ubiquitous environments, its components must be able to adapt themselves to the current context. To deal with this issue, we propose in this paper an approach aiming at reconfiguring the component structure to allow a flexi- ble deployment of its services according to its use context. This adaptation focusing on the service continuity, consists of determining a structure adapted to the execution context. Then, the current structure is automatically reconfigured and the generated components are redeployed. Categories and Subject Descriptors D.2.7 [Software Engineering]: Distribution, Maintenance, and Enhancement—Restructuring, reverse engineering, and reengineering General Terms Algorithms, Design, Measurement, Performance Keywords Software component, self-adaptation, restructuring, deploy- ment, ubiquitous systems, context-awareness, clustering 1. INTRODUCTION For several years, ubiquitous computing has emerged as a challenge field for application design. In fact, due to the huge development of mobile devices, designers have to create applications able to adapt themselves to the new conditions which can modify service continuity. For example, a user device can have scarce resources, such as low battery power, slow CPU speed and limited memory. So when an applica- tion is executed on such a device, these hardware resources Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. ICPS’08, July 6–10, 2008, Sorrento, Italy. Copyright 2008 ACM 978-1-60558-135-4/08/07 ...$5.00. can become insufficient for guaranteeing service continuity. In this case, the application must adapt itself. In addition, more and more applications are created by as- sembling reusable parts. In Component-Based Software En- gineering (CBSE), an application consists of existing compo- nents [4]. To be executed in ubiquitous environments where context is perpetually evolving, a component must adapt itself. Adaptation can concern component behavior or com- ponent structure. Existing work [2, 3] focuses on adapting component behavior and few works are related to the struc- ture. Besides monolithic components are considered as de- ployment units which cannot be structurally adapted. In fact, the existing work focuses on the placement of compo- nents or sub-components within a distributed infrastructure. However, adapting the component structure can be re- quired in many cases. To illustrate this, let us consider an example of a monolithic component which has to be deployed on an infrastructure composed only by resource-constrained machines. Moreover, no machine can deploy the component because their resources are insufficient. So the component has to be adapted. This adaptation can be achieved by frag- menting the component structure and by distributing some of its services through the infrastructure. Now, imagine that a sudden fall in the available memory involves a breakdown in its service continuity. So the component must adapt itself to these conditions since runtime. While being based on the above considerations, we pro- pose an approach aiming at reconfiguring component struc- ture in order to achieve a flexible deployment of its services. In previous work [1], we developed an approach allowing an application administrator to adapt the software compo- nent structure since runtime. However, due to the contin- ual context evolution, a manual decision-making cannot be achieved. So we propose to automate this task. We discuss our approach as follows. Section 2 presents the self-adaptation of component structures. Section 3 de- tails the decision-making mechanisms. Conclusion and fu- ture work are presented in section 4. 2. STRUCTURAL SELF-ADAPTATION 2.1 Definitions and motivations In ubiquitous environments, the context is always chang- ing. So a component which has been deployed on a resource- constrained device, is not able to guarantee its service conti- nuity without adapting itself to the current hardware archi- tecture. This adaptation can consist in fragmenting and dis- tributing its structure according to the available resources. 173