Documente Academic
Documente Profesional
Documente Cultură
Applications (SEAA 2010), Date-Added = 2010-06-07 10:37:26 +0200, Date-Modified = 2010-07-23 09:56:36 +0200 (2010)"
Abstract type of service (turning light on and off) but different actual
There is a growing interest in leveraging Service Oriented services, if only because they are located in different rooms.
Architectures (SOA) in domains such as home automation, These loose coupling and proper separation between types
automotive, mobile phones or e-Health. With the basic idea and instances are however well known in Component Based
(supported in e.g. OSGi) that components provide services, it approaches.
makes it possible to smoothly integrate the Internet of Things Besides, IoT-based applications are also characterized by the
(IoT) with the Internet of Services (IoS). The paradigm of fact that things and their associated software are introduced
the IoS indeed offers interesting capabilities in terms of dy- or removed from an execution environment at runtime. Sup-
namicity and interoperability. However in domains that in- porting this degree of dynamism is usually done programmat-
volve “things” (e.g. appliances), there is still a strong need ically, and our experience intends to simplify this task and to
for loose coupling and a proper separation between types provide developers with an explicit view of the system archi-
inria-00538469, version 1 - 22 Nov 2010
and instances that are well-known in Component-Based ap- tecture, while supporting its dynamic evolution. This paper
proaches but that typical SOA fail to provide. This paper presents how we can get the best of both worlds by augment-
presents how we can still get the best of both worlds by aug- ing an OSGi-based SOA with a Component Based approach.
menting SOA with a Component-Based approach. We illus- The rest of this paper is organized as follows. An investi-
trate our approach with a case study from the domain of home gation on existing tools and approaches in component and
automation. services domain is conducted in section 2, and leads to a list
of requirements for integrating service based approach and
Acknowledgment component based approach for IoT system. Then our contri-
*
The research leading to these results has received bution using component-based approach on a service-based
funding from the European Community’s Seventh Frame- execution environment is detailed, illustrated and evaluated
work Program FP7 under grant agreements 215483 (S- in section 3. Section 4 places our contribution with relation
Cube, http://www.s-cube-network.eu/) and 215412 (DiVA, to other approaches close to ours. Section 5 concludes and
http://www.ict-diva.eu/). highlights future work.
1
vices. They offer a mean to integrate legacy software as ser- OSGi components can directly react on the appearance and
vices into the business service orchestration. Every service is disappearance of services.
declared within the scope of the ESB runtime, which acts as
the only mediator of services in the enterprise. The mechanisms provided by OSGi to manage the cou-
The JBI component model defines components with inde- pling are not sufficient in the context of IoT. Since the cou-
pendent life-cycle, that communicate through their services pling is explicitly hard-coded inside the bundles, any change
over a normalized message middleware. This middleware to the service discovery and the binding policies implies re-
acts as an abstraction layer for communications, and facili- placing the bundle. Indeed, the application architecture is
tates the integration of legacy software. According to their never made explicit and the OSGi platform only offers very
function, JBI components are split into two categories: limited introspection primitives.
• Service Engine Components are directly hosted by the 2.2 In Components domain
JBI runtime environment and cannot communicate out-
side of this scope. They are in charge of message pro- Fractal [2] is a modular and extensible component model
cessing, routing or orchestrating services. to design, implement, deploy and reconfigure various sys-
tems and applications. Famous implementations of Fractal
• Binding Components expose or consume standard JBI are Julia and AOKell (Java), Cecilia (C), FractNet (.NET)
services and perform the bindings with external non- and FracTalk (SmallTalk).
standard software. The Fractal component model supports the definition of
inria-00538469, version 1 - 22 Nov 2010
2
reuse by third party applications complicated if not foreseen Migration
in advance. At last, the dynamicity of an application running
Reflection Target
over Fractal is compromised because the deployment of new Model (source) Model
components can not be done at runtime without restart.
tion capabilities making it possible to build a model view of person. The reconfigurations of the system must fit within
the running system. SOA execution platforms do not have this constraint, or more specifically, the transition time from
such an ability. a stable configuration to another one should not exceed this
Rq2: Components coupling managed from outside For the limit.
components to be highly independent, they must not em-
bed any dependency resolution mechanism. Moreover, this 3 Description of the solution
extraction would make it possible to modify the resolution Models At Runtime technics are used to address the first
policies, or change the connections to adapt the system with requirement. An engine capable of reasoning on the runtime
no need to deal with business components. Having a clear model manages the connections and deployments of compo-
and explicit description of the relations between components nents. The wrapping of components into bundles makes it
gives a better understanding and makes the analyze of the possible to register services from a component and open it
system much more accurate and so, leads to better adaptation to the world as required in Rq3. Then the underlying OSGi
decisions. platform natively supports the Rq4.
The component connections are often explicit in Component- The next paragraphs describes our contribution in more de-
Based systems, but are never in SOA, and dependencies res- tails through different point of view highlighting our answers
olutions are even hard coded in services. to the requirements. A little example and an evaluation of the
Rq3: Interoperability and opening to the outside world is an tool are presented on follow.
essential principle in IoS. The goal is to offer a service in a
standardized way to any other system that would like to use 3.1 Solution in details
it. Even if the system is managed as a component based ap- Models at Runtime
plication, any third party application must be able to use the In order to ensure reflexivity(Rq1), the system keeps a model
services offered by the managed devices (IoT speaking) and of the actual running objects/components and their connec-
more generally components. Services must thus be exposed tions (bindings) at any time. Configurations, reconfigurations
as classical services, while their ’component like’ manage- and adaptations of the system are handled as follow.
ment should remain hidden. Model creation In the cases of a first configuration or a
This is natively offered by SOA using interfaces and reg- reconfiguration of the system, the target model is given to
istries to exposes services to the world. Component-Based the system by a human person. For an adaptation, the tar-
applications are in the other hand, living in their close world. get model is automatically derived from a Dynamic Software
Rq4: Hot deployment ability is absolutely necessary to en- Product Line model [4, 13, 10, 8]. This derivation is driven
sure future evolutions and adaptations to the protocols and by a reasoner component which selects the features most
devices. The execution platform must support dynamic de- adapted for the current context. This reasoner then derives
ployments and adaptations of the application during runtime the corresponding architectural model using model compo-
with no restart. sition techniques. This model (if valid) is stored in a cache,
SOA consider that services appear and disappear at any time. which is managed according to a standard caching algorithm.
The hot deployment is thus essential and natively taken into Online Validation This step relies on invariant checking:
account. Component-based applications do not address this for all the produced configurations, we check that all the
3
invariants are satisfied. The open-source Kermeta metamod-
elling language [14] is used to manage different checking
strategies and check all the invariants (expressed using an
OCL-like syntax). We distinguish between two types of in-
variants: generic and application-specific. Generic invariants
can for example check that all the mandatory client ports are
bound to compatible server ports. Application-specific in-
variants can for example check that the EnTiMid application
always has a communication component.
4
ment (Rq4) is made using a chain of actions. This chain is
presented in Fig. 2 and explained in the following.
Step A shows the model of the new configuration has to
reach. This step starts the chain.
Step B The Model@Run-Time Engine asks the Instance Cre-
ator to embed a new component instance into a new bundle.
To do so, the Instance Creator generates an activator and a
manifest, according to the instance informations given by the
M@Rt engine. The Manifest, like any classic OSGi bundle
manifest, gives information about the packages needed for
the bundle to run, and which are the new provided packages.
Figure 3. Simple example of architecture
The role of the activator is to ask a factory for a new instance
of the device at bundle start. Then, it registers the component At this point, it is interesting to note the clear separa-
as a service implementing the component type. The proper- tion of component type/implementation/instance. There are
ties of the service registration gives the instance name for the only two component types Functional components and De-
system to be able to find the components. The activator is a vice components. These components can have multiple im-
Java class that needs to be compiled before being included in plementations: Parallelizer, Sequencer, EventPublisher, for
the bundle. functional components, and TYXIA 510, RMG4S, Nabaztag
for device components. At last, multiple instances of each
inria-00538469, version 1 - 22 Nov 2010
5
During the day, the system is composed (amongst other 3500
6
iment. This cache of OSGi components can easily be ini- can help finding these unwanted conflicts and avoid them by
tialized by a component that periodically iterates on a set of selecting the most appropriate available service.
configurations (e.g. every 5 or 10 seconds during ldle time), The resolution mechanism of BluePrint, its dynamicity
and generates the necessary bundles to reconfigures the ap- offered by the event listener mechanism, and the use of
plication with each configuration. This way, it is possible XML declarative files instead of compiled code, can really
to initialize the cache a few minutes after the installation of be helpful in our case, but a development effort is needed for
EnTiMid. Moreover, the compiling and packaging of a com- BluePrint to be able to load and work with completely speci-
ponent that would not be present in cache could also be ex- fied models. In the future, we will probably try to integrate it,
ternalized to a third party system, with more computation ca- and measure how efficient the BluePrint resolution is, com-
pacities, that would simply return the jar file of the required pared to our implementation.
component. The main benefit of our proposition is the fact that the
component model is still available at runtime, consequently
4 Related works
we obtain a reflexive component runtime for OSGi. This
Besides the tools listed in section 2, the approaches de- idea of models@runtime can ease the implementation of run-
scribed in the following clearly appears as alternative solu- time model checking or the implementation of the adaptation
tions. Indeed, this section aims at positioning our proposition layer.
with relation to these.
SCA. SCA is a standard specification that provides a com-
BluePrint. OSGi describes a dynamic component frame-
ponent model for Services Based Applications. It has several
work. This framework provides low-level mechanisms for
inria-00538469, version 1 - 22 Nov 2010
7
Other approaches. Providing an ADL on top of OSGi [2] E. Bruneton, T. Coupaye, M. Leclercq, V. Quéma, and J. Ste-
is an issue that have been addressed by several works [6]. fani. The FRACTAL Component Model and its Support in
For example, Cervantes et al presents in [9] an approach to Java. Software Practice and Experience, Special Issue on Expe-
describe dynamic sensor-based applications using a declara- riences with Auto-adaptive and Reconfigurable Systems, 36(11-
tive language called WADL. As IoT system dynamic sensor- 12):1257–1284, 2006.
based applications are characterized by the fact that measure- [3] H. Cervantes and R. S. Hall. Autonomous adaptation to dy-
namic availability using a service-oriented component model.
ment producers (sensors) and consumers are introduced or
In ICSE’04: 26th International Conference on Software Engi-
removed from an execution environment at runtime. Sup- neering, pages 614–623, Washington, DC, USA, 2004. IEEE
porting this degree of dynamism is usually done program- Computer Society.
matically, and the WADL intends to simplify this task and to [4] C. Cetina, P. Giner, J. Fons, and V. Pelechano. Autonomic
provide developers with an explicit view of the system archi- Computing through Reuse of Variability Models at Runtime:
tecture, while supporting its dynamic evolution. They also The Case of Smart Homes. Computer, 42:37–43, 2009.
show in [5] how a scripting language can be used to recon- [5] D. Donsez, K. Gama, and W. Rudametkin. Developing adapt-
figure the running system. WADL addresses mainly the pro- able components using dynamic languages. In 35th EUROMI-
ducer/consumer interaction type between components. In- CRO Conference on Software Engineering and Advanced Ap-
deed, WADL does not managed Component Assembly and plications (SEEA) 2009, August 27-29th, 2009, 2009.
Component Instances (wireapps) uniformly. [6] C. Escoffier, R. S. Hall, and P. Lalanda. ipojo: an extensible
service-oriented component framework. Services Computing,
5 Conclusions and perspectives IEEE International Conference on, 0:474–481, 2007.
inria-00538469, version 1 - 22 Nov 2010
Building easily configurable applications for house au- [7] M. Fowler. Inversion of control containers and the dependency
tomation, e.g. in the context of Ambient Assisted Living injection pattern, January 2004.
(AAL), is a complex undertaking because it has to marry [8] S. Hallsteinsen, M. Hinchey, S. Park, and K. Schmid. Dynamic
the ever evolving needs of the customers with the diversity Software Product Lines. IEEE Computer, 41(4), April 2008.
of devices, appliances, communication links, communication [9] L. T. Humberto Cervantes, Didier Donsez. An architecture de-
scription language for dynamic sensor-based applications. In
protocols available in this domain. The paradigm of the IoS
Proc. of 5th IEEE Consumer Communications and Networking
indeed offers interesting capabilities in terms of dynamicity
Conference (CCNC) 2008, Las Vegas, Janvier 2008., 2008.
and interoperability, but fails to provide the loose coupling,
[10] P. Istoan, G. Nain, G. Perrouin, and J.-M. Jézéquel. Dynamic
a proper separation between types and instances, and mech- software product lines for service-based systems. In 9th IEEE
anisms to deploy and manage services, that are needed in International Conference on Computer and Information Tech-
domains that involve things. nology, Xiamen, CHINA, octobre 2009.
After a study of different tools existing in service-based and [11] J. Kramer and J. Magee. The evolving philosophers problem:
component-based domains, we identified a list of require- dynamic change management. Software Engineering, IEEE
ments for an execution environment to be fully adapted to Transactions on, 16(11):1293–1306, Nov 1990.
the integration of Internet of Things and Internet of Services. [12] M. Léger, T. Ledoux, and T. Coupaye. Reliable dynamic re-
To meet the identified requirement, a new tool having an configurations in the fractal component model. In ARM ’07:
explicit and independent reflexion model of the architecture Proc of the 6th international workshop on Adaptive and reflec-
living at runtime has been created. In this model, ”things” tive middleware, pages 1–6, Newport Beach, CA, 2007. ACM.
and ”services” are managed the same way to enforce the in- [13] B. Morin, O. Barais, J.-M. Jézéquel, F. Fleurey, and A. Sol-
teroperability and the opening to the outside world of IoT berg. Models@ run.time to support dynamic adaptation. Com-
puter, 42(10):44–51, 2009.
applications. Moreover, components and the application be-
[14] P.-A. Muller, F. Fleurey, and J.-M. Jézéquel. Weaving Exe-
havior are managed from outside of the components offering
cutability into Object-Oriented Meta-Languages. In Proceed-
the system a great flexibility. Then components can be de- ings of MODELS/UML’2005, volume 3713 of LNCS, pages
ployed or removed with no restart of the system making any 264–278, Jamaica, octobre 2005. Springer.
change or adaptation transparent for users. [15] G. Nain, E. Daubert, O. Barais, and J.-M. Jézéquel. Using
Home automation and more generally the domain of mde to build a schizofrenic middleware for home/building au-
human-machine interactions, considers the time for an action tomation. In S. B. . Heidelberg, editor, Towards a Service-
to be perceived as immediately realized must be less than Based Internet, volume 5377/2008 of Lecture Notes in Com-
250 milliseconds. Our experiments show that the system we puter Science, pages 49–61, Madrid, Spain, décembre 2008.
create is not far from this limit and may require more inves- IRISA/INRIA/University of Rennes1.
tigation on alternative solutions to gain on time. [16] J. Zhang, B. H. C. Cheng, Z. Yang, and P. K. McKinley. En-
abling safe dynamic component-based software adaptation. In
References R. de Lemos, C. Gacek, and A. B. Romanovsky, editors, WADS,
[1] G. Blair, G. Coulson, J. Ueyama, K. Lee, and A. Joolia. Open- volume 3549 of Lecture Notes in Computer Science, pages
com v2: A component model for building systems software. In 194–211. Springer, 2004.
IASTED Software Engineering and Applications, USA, 2004.