The remainder of this paper is organized as follows.
Section 2 explains the overall approach and the way
in which CB concepts have been translated into OO
concepts to generate executable programs, resulting
in the development of an OO implementation frame-
work. Section 3 explains the importance of including
in the framework support for component distribution,
as well as to justify the approach taken to do so. Sec-
tion 4 explains in detail component deployment. Fi-
nally, Section 5 presents the conclusions and future
work.
The paper considers the domain of service robots,
but it could be extended to other domains with sim-
ilar characteristics, since we consider “generic” or
“domain-independent” concepts.
2 GENERAL OVERVIEW AND
PREVIOUS WORKS
Our global development approach starts by mod-
elling the architecture of the application using the
CBSD approach, and then use a series of model
transformations to generate both analysis models
and executable code. Though any modelling lan-
guage can be used for performing the first step,
we developed our own modelling language, entitled
V
3
CMMV3CMM V
3
CMMV3CMM (Iborra et al.,
2009). This language provides three complementary
but loosely coupled views that allows designers to de-
fine and connect software components, namely: (1) an
architectural view to define components (interfaces,
ports, services offered and required, composite com-
ponents, etc.), (2) a coordination view to specify com-
ponent behaviour, based on timed automata theory,
and finally (3) an algorithmic view to express the se-
quence of actions executed by a component according
to its current state, based on activity diagrams.
In order to ease the generation of executable code
from the application expressed in terms of architec-
tural components, an OO framework was designed
and implemented (Pastor et al., 2010). Such frame-
work provides the base classes for implementing the
components of the architectural design defined in
V
3
CMMV3CMM, and an infrastructure for the user
to choose the concurrency features that he ultimately
wants for the application: number of threads, code
allocated to such threads, deadlines, priorities, etc.
The framework provides an OO interpretation of the
CBSD concepts that allows translating the CB de-
signs to OO applications. The design and documen-
tation of the framework was carried out using de-
sign patterns, which is a common practice in Soft-
ware Engineering (Buschmann et al., 2007). Figure
fig:secuenciaPatrones shows the sequence of patterns
applied to the design of the framework in order to
meet the following requirements:
1. Control over concurrency policy: thread number,
thread spawning (static vs. dynamic policies) and
thread characteristics (deadline, period, priority,
etc.), scheduling policy (fixed priority schedulers
vs. dynamic priority scheduler). Unlike most
frameworks, these tasking issues are very impor-
tant for us, and can be selected by the user of the
framework.
2. Control over the allocation of activities to threads,
that is, control over the computational load as-
signed to each thread. The framework allows allo-
cating all the activities to a single thread, allocat-
ing every activity to its own thread, or a combina-
tion of both policies. In any case, the framework
design ensures that only the activities belonging
to active states are executed.
3. Control over the communication mechanisms be-
tween components. The communication mecha-
nism implemented by default in the framework is
the asynchronous without reply scheme, based on
the exchange of messages.
4. Facilitate the instantiation of the framework to ob-
tain OO code from the CBSD model.
5. Control over the distribution policy of the compo-
nents in computational nodes.
The framework defines extra regions and activi-
ties to manage the flow of messages through ports,
the internal memory of the component, and each re-
gion of the component’s state machine. It is worth
highlighting that this design facilitates schedulability
analysis, since no code is “hidden” in the framework
implementation, but it must be explicitly allocated to
a particular thread.
With all this, the framework code is organized into
three groups with clearly defined interfaces: (C1) pro-
vides the runtime support, (C2) provides an OO inter-
pretation of the CBSD concepts and the framework
’hot-spots’, and (C3) the application-specific code
that supplement the ’hot-spots’ of the framework to
create a specific application. This classification en-
ables providing an alternative interpretation of CBSD
concepts (C2) that use the same run-time (C1), and
reusing the same application (C3) in a different run-
time (C1), provided that C2 is not changed.
3 COMPONENT DISTRIBUTION
Despite the number of currently available middleware
technologies, we decided to develop an ad-hoc mid-
AN IMPLEMENTATION FRAMEWORK FOR COMPONENT-BASED APPLICATIONS WITH REAL-TIME
CONSTRAINTS - Extensions for Achieving Component Distribution
291