<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>A UML-Profile for domain specific patterns: Application to real-time</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Saoussen Rekhis</string-name>
          <email>saoussen.rekhis@fsegs.rnu.tn</email>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Nadia Bouassida</string-name>
          <email>2nadia.bouassida@isimsf.rnu.tn</email>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Rafik Bouaziz</string-name>
          <email>raf.bouaziz@fsegs.rnu.tn</email>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Bruno Sadeg</string-name>
          <email>3bruno.sadeg@univ-lehavre.fr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>LITIS, UFR des Sciences et Techniques</institution>
          ,
          <addr-line>BP 540, 76 058, Le Havre Cedex</addr-line>
          ,
          <country country="FR">France</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2010</year>
      </pub-date>
      <fpage>32</fpage>
      <lpage>46</lpage>
      <abstract>
        <p>The design of Real-Time (RT) applications is a difficult task since it must take into account the specification of time-constrained data and timeconstrained transactions. The design of these applications can be facilitated through the reuse of RT design patterns that improve software quality and capture RT domain knowledge and design expertise. However, the difficulty of RT design patterns comprehension reinforces the need for a suitable design language. This language has to express concepts modeling RT features and distinguishing the commonalities and differences between RT applications. This paper presents new UML notations that take into account the design of both RT specific concepts and the variability of domain specific patterns. The UML extensions are, then, illustrated in the RT context using an example of a controller pattern.</p>
      </abstract>
      <kwd-group>
        <kwd>UML notation</kwd>
        <kwd>domain specific patterns</kwd>
        <kwd>instantiation</kwd>
        <kwd>realtime applications</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>
        A design pattern [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] is a description of a solution to a common problem in software
design. It captures the design expertise necessary for developing applications and
allows the reuse at both the design and code levels. Design patterns can be general and
cover different domains of application (e.g. patterns of GoF [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]) and they can, also, be
intended for a particular domain, in this case they are called domain-specific patterns
[
        <xref ref-type="bibr" rid="ref24">24</xref>
        ].
      </p>
      <p>
        Despite their advantages, to benefit from design patterns, a designer must spend a lot of
time in understanding and then reusing the design pattern in a certain application. To
facilitate the reuse and instantiation phase, many design pattern notations have been
proposed ([
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]). The proposed approaches offer essentially UML extension
mechanisms such as stereotypes, tags and constraints to cope with the pattern
variability and to show the pattern specificities.
      </p>
      <p>A UML Profile for domain specific patterns: Application to real-time 33
These design languages with their UML extensions remain insufficient when they deal
with a specific domain. In fact, in the design of a specific domain, the design language
has to take into account not only the variability and the aspects relative to the pattern,
but also the extensions and specificities of the domain itself. For example, when
considering the Real Time (RT) domain, we found that this domain has many details
that must be taken into account by the design pattern notation.</p>
      <p>In fact, RT applications, which manipulate voluminous quantities of data, have two
main features: i) they manipulate RT data that must closely reflect the current state of
the controlled environment, and ii) they must be able to meet RT constraints of
transactions. These two features must be considered by RT design patterns.</p>
      <p>This paper proposes a new UML-profile that extends UML with concepts related to
RT design patterns. The motivations behind these extensions are three-folds. The first
motivation is to have flexible patterns that distinguish the fixed parts from the optional
and variable elements in the pattern. The second motivation is to facilitate the
comprehension of design patterns instantiation and to guide a designer to derive a
specific application. The third motivation is to present design patterns for the RT
domain using the proposed profile which is extended with RT specific concepts.</p>
      <p>The remainder of this paper is organized as follows. Section 2 overviews and
evaluates currently proposed design languages and their extensions. Section 3 presents
our proposition to represent an UML profile for RT design patterns. Section 4
illustrates the design language with a RT controller pattern and presents an example of
a freeway traffic management system reusing it. Section 5 concludes the paper and
outlines future work.</p>
    </sec>
    <sec id="sec-2">
      <title>2 Overview of current works</title>
      <p>In order, to propose a RT pattern profile, we have been inspired in our work from
RT profiles and existing pattern notations. Thus, in this section we, first, overview
current design languages for pattern's representation. For this reason, we define a set of
criteria necessary for pattern notations and then we present their advantages and limits.
Second, we briefly present in Subsection 2.2 the RT profiles and the UML extensions
taking into account the real-time system requirements.</p>
      <sec id="sec-2-1">
        <title>2.1 Overview of UML extensions for design patterns representation</title>
        <p>Several criteria have to be taken into account to evaluate the currently proposed
languages for pattern representations. These criteria are used to compare current
UMLbased pattern notations, for the specification of general and domain-specific design
patterns and for their instantiation.
- Criteria for design pattern representation at the specification level</p>
        <p>
          C1. Expressivity: Design patterns have mostly been described using natural
language, complex mathematical or logic based formalisms [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ] which are not easily
understood by an inexperienced designer. This leads to complications in incorporating
design patterns effectively into the modelling of a new system. To remediate to this
difficulty, the solution is using an expressive visual notation based on UML to specify
patterns. This improves the pattern specification quality because UML allows to easily
visualise, define and document the artefacts of the system under development.
        </p>
        <p>C2. Variability: The design patterns have to incorporate flexibility and variability in
order to guide the designer in determining the variable elements that may differ from
one application to another. In fact, variability is classified into optional and alternative
characteristics. So, it is important to show the optional elements which can be omitted
in a pattern instance. It is also necessary to clarify the variability points (called
hotspots) which describe the elements that can vary according to a specific context.</p>
        <p>
          C3. Constraints definition: The correct instantiation of patterns is a major problem
when we want to design a new system by composing design patterns. The validity of an
instantiation depends on respecting the properties inherent to the solution. These
properties are specified by constraints that are generally expressed in OCL (Object
Constraint Language) [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]. They are presented on the class diagram using notes.
- Criteria for design pattern representation at the instantiation level
        </p>
        <p>
          C1. Traceability: The traceability consists of easily identifying design patterns
when they are applied and composed with other patterns. In fact, we not only need to
identify each pattern in a design, but also we want to show the methods and attributes
that play important roles in the pattern. Explicit representation of the key methods and
attributes can assist on the traceability of a pattern since it allows us to trace back to the
design pattern from a complex design diagram [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ].
        </p>
        <p>
          C2. Composition: The development of applications using design patterns as design
components requires a careful look at composition techniques, which are categorized
as: behavioural composition techniques and structural composition techniques. Indeed,
the behavioural techniques show how dynamic specifications of patterns can be
composed using sequence diagram, whereas structural techniques show how the static
architectural specifications of instantiated patterns can be composed using class
diagram [
          <xref ref-type="bibr" rid="ref16">16</xref>
          ].
- UML notations for design patterns
There are several UML notations which proposed extensions to present general design
patterns and domain models. Many of them can be used to express concepts relative to
domain-specific design patterns such as their flexibility. A comparison of the most
recent notations, using the specification and instantiation criteria is proposed in Tables
1 and 2.
        </p>
        <sec id="sec-2-1-1">
          <title>P_UML proposes</title>
          <p>extensions showing the
pattern hot-spots in a
class diagram and
guiding the designer in
instantiating a pattern.
However, it does not
distinguish between the
extensions used in
pattern instantiation
from those used in
pattern specification,
which reduces the
expressivity of
notations.</p>
          <p>This profile is not very
expressive since the
static view of a pattern
is presented by very
elementary separated
packages which contain
one or two classes. This
reduces the
understanding and
makes the composition
more difficult.</p>
        </sec>
        <sec id="sec-2-1-2">
          <title>ADOM-UML is an</title>
          <p>Application based
DOmain Modeling
approach, in which
UML 2.0 is used as the
modeling language of
both: the domain and</p>
        </sec>
        <sec id="sec-2-1-3">
          <title>Unlike several others notations [8] [4], the proposed profile does not focus on specifying the variability of a pattern solution.</title>
          <p>This profile is characterized by:
-The definition of tagged values
to extend the static view:
{variable} indicates that the
method implementation varies
according to the pattern
instantiation;
{extensible} indicates that the
class interface may be extended
by adding new attributes and/or
methods;
-The applicability of the
{incomplete} constraint on
generalization relation to indicate
that new classes may be added
during the pattern instantiation
Unlike all previous notations, this
profile focuses on the variability
in the functional, dynamic and
static views. The use case
diagram is the entrance point for
the instantiation process, where
the application designer selects a
functionality variant. However,
the use case diagram is too
abstract and can not be used as an
input model for the patterns
instantiation. In fact, the use case
diagram is at a high level of
abstraction and thus the designer
cannot identify, for example, the
optional attributes or methods
according to its needs.</p>
          <p>ADOM-UML defines new
stereotypes in order to denote the
multiplicity variability of the
different domain model elements.
The multiplicity stereotypes aim
to represent how many times a
model element can appear in a
Definition
of constraint</p>
        </sec>
        <sec id="sec-2-1-4">
          <title>These notations</title>
          <p>don’t specify
constraints which
delimit the pattern
applicability.</p>
          <p>These notations
propose to define
the pattern
constraints
through notes
containing OCL
constraints.</p>
        </sec>
        <sec id="sec-2-1-5">
          <title>Similar to</title>
          <p>P_UML, this
profile uses notes
that contain OCL
constraints. These
latter must be
fulfilled by a
pattern to be
applied correctly.</p>
          <p>The constraints
are well defined
in ADOM-UML
among the
different layers:
the domain layer
enforces
application models.</p>
          <p>
            Unlike the previous
works [
            <xref ref-type="bibr" rid="ref3">3</xref>
            ] [
            <xref ref-type="bibr" rid="ref4">4</xref>
            ] [
            <xref ref-type="bibr" rid="ref8">8</xref>
            ], the
ADOM-UML enhances
the expressivity of the
proposed notations
since it well
differentiates between
the extensions used in
the language, domain
and application layers.
          </p>
          <p>This means that each
layer includes modeling
constructs that will be
used in the more
specific layer.
specific context. Particularly, the
authors define four stereotypes:
&lt;&lt;optional single&gt;&gt;, &lt;&lt;optional
many&gt;&gt;, &lt;&lt;mandatory single&gt;&gt;
and &lt;&lt;mandatory many&gt;&gt;. Each
stereotype has two associated
tagged values, min and max,
which define the lowest and the
upper most multiplicity
boundaries. However, the word
‘many’ used in these stereotypes
doesn’t enhance the semantic of
UML model since each element
in a model can be instantiated
implicitly many times.
constraints on the
application layer,
while the
language layer
enforces
constraints on
both domain and
application layers.</p>
          <p>Besides,
ADOMUML specifies
additional
constraints and
dependencies in
the domain layer
expressed in
OCL.</p>
          <p>This profile proposes new stereotypes and tagged
values for the explicit representation of design
patterns in software designs. These extensions
show the pattern name, the role names of the
classes, the attributes and the operations in the
pattern and how many instances of a design pattern
are applied.</p>
          <p>This notation proposes to show the pattern
participant roles by using an ellipse in the bottom
of a class that indicates the pattern name and the
role through which this class participates in the
pattern. Thereby, it provides support for traceability
of pattern instantiation. However, the class diagram
may seem to be overloaded since the notation
presents an association between ellipses to join the
elements of the same pattern.</p>
        </sec>
        <sec id="sec-2-1-6">
          <title>This profile defines a process to show the steps of</title>
          <p>patterns instantiation. However, it does not permit
the visualization and preservation of pattern-related
information in patterns instances in a design model.
Consequently, it does not deal with the traceability
criterion.</p>
          <p>The connection between the domain and
application layers is done through the stereotypes
extension mechanism. This means that a domain
element can serve as a stereotype of an application
Composition
This profile deals with the
composition of patterns
statically. That is, when two
or more classes represent
the overlapping part of the
composition, the proposed
notation shows the roles
that these classes play in
each pattern.</p>
          <p>
            Like the previous work [
            <xref ref-type="bibr" rid="ref3">3</xref>
            ],
this profile proposes
extensions showing the
composition of patterns
presented by class
diagrams. It does not
present notations to deal
with the composition of
patterns dynamic
specifications.
          </p>
        </sec>
        <sec id="sec-2-1-7">
          <title>This profile does not</title>
          <p>present mechanisms to
compose neither static, nor
dynamic specifications of
patterns.</p>
        </sec>
        <sec id="sec-2-1-8">
          <title>The composition criterion is not taken into account in domain models. In fact, an application model is created</title>
          <p>A UML Profile for domain specific patterns: Application to real-time 37
element if their meta-classes in the language layer
are the same (e.g., a class that appears in a domain
model may serve as a classifier of classes in an
application model). Thereby, ADOM-UML
provides support for traceability criterion and
enhances the readability of an application model.
according to the adaptation
of one domain model and
doesn’t deal with the
composition of many
reusable domain artefacts,
such as patterns.</p>
          <p>In summary, none of the proposed notations satisfies all the different specification and
instantiation criteria, when representing patterns. Moreover, none of them proposes
extensions showing the behavioral composition.</p>
        </sec>
      </sec>
      <sec id="sec-2-2">
        <title>2.2 Overview of UML extensions for RT applications</title>
        <p>
          Several works have proposed UML extensions to take into account the real-time
system requirements such as, RT-UML [
          <xref ref-type="bibr" rid="ref20">20</xref>
          ] and ACCORD/UML [
          <xref ref-type="bibr" rid="ref21">21</xref>
          ]. The basic
concepts of RT-UML were integrated in the UML standard through the UML profile for
Schedulability, Performance, and Time (denoted SPT profile) [
          <xref ref-type="bibr" rid="ref22">22</xref>
          ]. Recently, MARTE
profile [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ] for Modeling and Analysis of Real-Time Embedded systems has been
standardized by the OMG. It is intended to replace the existing UML Profile for SPT
profile [
          <xref ref-type="bibr" rid="ref22">22</xref>
          ]. MARTE consists in defining extensions that provide high-level modelling
concepts to deal with RT and embedded features modeling as well as specific modeling
artifacts to be able to describe both software and hardware execution supports.
        </p>
        <p>
          Another work proposed the UML-RTDB profile [
          <xref ref-type="bibr" rid="ref23">23</xref>
          ] to express real-time database
features in a structural model. Unlike the previous profiles, it supplies concepts for
real-time database modeling such as RT attributes, RT methods and RT classes. In
addition, UML-RTDB specifies two kinds of real-time attributes, sensor attributes and
derived attributes, in order to satisfy the requirements of current real-time applications.
However, some proposed stereotypes overlap with the UML extensions presented by
MARTE profile especially those relative to the RT methods. In fact, the UML-RTDB
stereotypes &lt;&lt;Periodic&gt;&gt;, &lt;&lt;Sporadic&gt;&gt; and &lt;&lt;Aperiodic&gt;&gt; that express
respectively periodic, sporadic and aperiodic methods in the class diagrams, has the
same meaning as the tagged value Occurrence Kind of the &lt;&lt;rtFeature&gt;&gt; stereotype
defined in MARTE. Thereby, we adapt some MARTE stereotypes modeling RT
aspects instead of the other UML extensions proposed for the modeling of RT
applications since MARTE is a standardized profile.
        </p>
        <p>Nevertheless, the only use of UML notations modeling RT application
characteristics is insufficient to specify RT design patterns. That is, RT patterns must
be generic designs intended to be specialized and reused by any application in RT
domain. For this reason, in addition to the UML extensions representing RT aspects,
we need new notations distinguishing the commonalities and differences between
applications in the pattern domain. Moreover, we need new concepts for the explicit
representation of the pattern elements roles for the traceability purpose.</p>
        <p>In the next section, we describe the extensions that we propose to take into account
these new concepts.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3 The UML profile for RT design patterns</title>
      <p>
        In the present work, we extend the unified modeling language “UML 2.1.2” [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] to
represent design patterns for RT applications. These extensions allow (i) to express the
variability in a pattern, (ii) to identify the roles played by each pattern element in the
application instantiating it and (iii) to specify RT applications constraints and their non
functional properties. The proposed extensions are described in the next section.
      </p>
      <sec id="sec-3-1">
        <title>3.1 UML extensions for specifying domain-specific patterns</title>
        <p>
          In this section, we propose new stereotypes showing the optional and fundamental
elements participating in a pattern and assisting the designer in pattern reuse. Thus, the
class diagram Metamodel is extended with the following stereotypes:
• Stereotype &lt;&lt;optional&gt;&gt; (applied to the Feature UML Metaclass): This stereotype
is inspired from &lt;&lt;optional single&gt;&gt; and &lt;&lt;optional many&gt;&gt; stereotypes defined in
[
          <xref ref-type="bibr" rid="ref18">18</xref>
          ]. In fact, the variety of applications within the RT domain is quite large. For this
reason, we can not specify exactly how many times a pattern element can appear in a
specific RT application. Thus, we use &lt;&lt;optional&gt;&gt; stereotype to represent the
optional features (i.e. attribute or method) that can be omitted in a pattern instance.
Each method or attribute which is not stereotyped &lt;&lt;optional&gt;&gt; in a fundamental
classifier (i.e. class, interface …) means that it is an essential element that plays an
important role in the pattern.
• Stereotype &lt;&lt;mandatory&gt;&gt; (applied to the UML Metaclasses: Class, Association,
Interface, Lifeline and ClassAssociation): This stereotype is inspired from
&lt;&lt;mandatory single&gt;&gt; and &lt;&lt;mandatory many&gt;&gt; defined in [
          <xref ref-type="bibr" rid="ref18">18</xref>
          ]. We propose the
&lt;&lt;mandatory&gt;&gt; stereotype to specify a fundamental element (association,
aggregation,…) that must be instantiated at least once by the designer when he models
a specific application. For the clarity purpose, a fundamental element in the pattern is
drawn with a highlight line like this class .
        </p>
        <p>
          Besides, each pattern element which is not highlighted means that it is an optional one,
except the generalization relation that permits to represent alternative elements. All the
attributes and methods of an optional class are implicitly optional.
• Stereotype &lt;&lt;extensible&gt;&gt; (applied to the UML Metaclasses: Class, Interface and
ClassAssociation): This stereotype is inspired from {extensible} tagged value proposed
in [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]. It indicates that the class interface may be extended by adding new attributes
and/or methods. Moreover, two properties related to the extensible stereotype are
proposed, in order to specify the type of features (attribute or method) that may be
added by the designer.
        </p>
        <p>
          - extensibleAttribute tag: It takes the value false, to indicate that the designer cannot
add new attributes when he instantiates the pattern. Otherwise, this tag takes the
value true.
- extensibleMethod tag: It indicates if the designer may add new methods when he
instantiates the pattern. The default value is true.
• Stereotype &lt;&lt;variable&gt;&gt; (applied to the Operation UML Metaclass): This
stereotype has the same meaning with the {variable} tagged value proposed in [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]. It
indicates that the method implementation varies according to the pattern instantiation.
3.2
        </p>
      </sec>
      <sec id="sec-3-2">
        <title>UML Extensions for instantiating domain-specific patterns</title>
        <p>
          Some of the existing notations (Dong &amp; Yang UML profile [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ] and P-UML profile [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ])
provide support on how to keep trace of the pattern when instantiated. These notations
focus only on generic design patterns for which it is difficult to recognize the pattern
instance when it is composed with others in a particular design. Thus, it is essential to
hold the pattern name and the role played by each element (class, attribute and method)
in the instantiation.
        </p>
        <p>
          However, a domain specific pattern is instantiated in the scope of a domain.
Therefore, it is easy to retrieve the pattern-related information even after the pattern is
applied or composed with other patterns. We assume that omitting both the name and
the role of pattern attributes and operations will not create any ambiguity. For this
reason, we propose to present only the pattern name and the role names of the classes
in order to avoid overloaded models. In fact, pattern-related information should be
minimized in the class and sequence diagrams for readability [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ].
        </p>
        <p>We propose to define two new stereotypes for the explicit visualization of patterns
in an application design:
• &lt;&lt;patternClass&gt;&gt; stereotype: It is applied to the Class UML metaclass in order to
indicate that it is an instantiated pattern class and not originally defined by the designer.
We propose to define two properties related to this stereotype:
- patternName tag : indicates the pattern name,
- participantRole tag : indicates the role played by the class in a pattern instance.
• &lt;&lt;patternLifeline&gt;&gt; stereotype: It is applied to the Lifeline metaclass in order to
distinguish between the objects instantiated from the pattern sequence diagram and
those defined by the designer. This stereotype has the same properties than
&lt;&lt;patternClass&gt;&gt; stereotype.</p>
        <p>These stereotypes allow to eliminate any confusion when patterns are composed. That
is, when two or more classes represent the overlapping part of the composition, the
proposed stereotype shows the roles that these classes play in each pattern.
3.3</p>
      </sec>
      <sec id="sec-3-3">
        <title>UML extensions for modeling RT aspects</title>
        <p>
          In addition to the above described stereotypes distinguishing the fixed parts from the
optional and variable parts in the pattern, the specification of RT design patterns needs
UML extensions supporting the modeling of RT aspects. Thus, we import stereotypes
from HLAM (High Level Application Modeling) and NFP (Non Functional Properties)
sub-profiles of MARTE [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ] (cf. figure 1). Note that MARTE provides support
required from specification to detailed design of RT embedded systems characteristics.
However, only the extensions describing RT applications features at a high level of
abstraction are taken into account since RT patterns can be instantiated to model many
RT applications and not only the embedded systems.
        </p>
        <p>From HLAM sub-profile, we import the &lt;&lt;rtFeature&gt;&gt; stereotype in order to model
temporal features. This stereotype extends the metaclasses: message, action, signal and
behavioral features. It possesses nine tagged values among which: relD1 (i.e.
specification of a relative deadline), absD1 (i.e. specification of an absolute deadline),
Miss (i.e. percentage of acceptance for missing the deadline), occKin (i.e. specification
of the type of event: periodic, aperiodic or sporadic)… . We propose to annotate each
model element that has real-time features with the previously described stereotype.</p>
        <p>RT patterns profile</p>
        <p>MARTE :: NFP sub-profile</p>
        <p>MARTE :: HLAM sub-profile
&lt;&lt;import&gt;&gt;
&lt;&lt;import&gt;&gt;
Instantiation pattern Extensions
Specification pattern Extensions</p>
        <p>Fig 1. RT pattern profile Metamodel</p>
        <p>From NFP Modeling sub-profile of MARTE, we import two stereotypes: &lt;&lt;Nfp&gt;&gt;
and &lt;&lt;NfpType&gt;&gt;. The first one extends the Property metaclass. It shows the attributes
that are used to satisfy non functional requirements. The second stereotype extends the
DataType metaclass. There is a set of pre-declared NFP_Types which are useful for
specifying NFP values, such as NFP_Duration, NFP_DataSize and NFP_DataTxRate.</p>
        <p>In the following section, we illustrate the RT design pattern profile through the
specification of RT controller pattern.</p>
        <p>A UML Profile for domain specific patterns: Application to real-time 41</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4 A RT design pattern example</title>
      <p>In this section, we propose to illustrate the proposed extensions through an example of
a reusable RT design pattern that explicitly shows the generic data which are
fundamental and which represent the core of RT applications, on the one hand, and the
allowed variants, on the other hand.</p>
      <sec id="sec-4-1">
        <title>4.1 RT controller pattern</title>
        <p>RT applications perform several RT processes among which: the RT data acquisition
and the data control processes. We focus in this paper on modeling the static as well as
the dynamic view of RT data control process through the definition of RT controller
pattern.</p>
        <p>
          - Interface:
Name: controller pattern
Context: This pattern is applicable in all RT applications which need to be managed by
Real Time Database (RTDB) systems. In fact, a RTDB has all the requirements of
traditional databases, but it also requires management of time-constrained data and
time-constrained transactions [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ].
        </p>
        <p>Intention: The pattern aims to model the control of the data acquired from environment
and the initialization of corrective action(s) if a violation is found.</p>
        <p>- Solution:
Static specification: Figure 2 presents the controller pattern static view.
Participants:</p>
        <p>- Observed_element: This class represents the description of a physical element that
is supervised by the controller. It can be an aircraft, a car, a road segment, and so on.
One or more measure types (i.e. Temperature, Pressure, etc) of each observed element
could determinate its evolution. These measures are classified into either base measures
or derived measures. Base measures stand for RT data that are issued from sensors,
whereas derived measures stand for RT data that are calculated by the controller using
base measures. The refreshment of each derived RT data is required every time one of
the base data is updated.</p>
        <p>The ObservedElement class has the ElmentID and ElementStatus fundamental
attributes. In addition, it has an UpdateStatus () method allowing to update the status of
observed element according to the variation of the captured values.</p>
        <p>- Controller: A controller has to monitor physical elements for responding to
conditions that might violate safety. It takes periodically the value captured for each
observed element as well as the minimum value and the maximum value that define the
interval for which the controller does not detect an anomaly. If a captured value does
not verify the boundary constraint, then the controller initiates some corrective actions,
such as a reset and a shut-down, or sends an alarm to notify an operator.</p>
        <p>
          On the other hand, the controller receives periodically an update message from an
observed element to notify it about the modification of its measures. In this case, the
controller is waiting for a message. If this message does not arrive on time, then the
controller performs appropriate recovery actions [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ].
        </p>
        <p>As illustrated in Figure 2, the controller class has four methods. The only fundamental
method is VerifyValue()since it is essential to check that the boundary constraints are
fulfilled for all RT applications. This method is performed periodically. In addition, it
must be achieved before a deadline. Thus, the VerifyValue()method is stereotyped
&lt;&lt;rtFeature&gt;&gt; in order to define the periodicity, the relative and absolute deadlines that
are tagged respectively period, relDl and absDl. The method CalculateDerivedValue()
is optional since it can be omitted in a pattern instantiation, when the designed
application does not have derived measures. It is stereotyped &lt;&lt;rtFeature&gt;&gt; since it is
sporadic and has to meet the deadline defined by the designer. The methods notify(),
initiateCorrection() are optional since the choice of the appropriate recovery action
depends on the application instantiating the pattern.</p>
        <p>- Operator: The alarm signals sent by the controller are supervised by the operators.
These latter provide decisions to validate reported incidents in case the controller only
reports errors and does not have the responsibility to take further actions; or in case the
confirmation of an operator is needed to achieve the correction.</p>
        <p>The Operator class is optional since the controller can take the correction initiative
without the intervention of an operator.</p>
        <p>Fig 2. Specification of RT controller pattern static view
Dynamic specification: Figure 3 presents the controller pattern dynamic view.
In order to verify the validity of each observed element measure, the controller takes
the current captured value and the value thresholds in parallel. Then, it verifies that
each measured value is in the closed range [Minimum-Value, Maximum-value]. If this
constraint is violated or the update message received from an observed element occurs
too late, then the controller notifies the operator or initiates the appropriate recovery
actions.
[For each measure of an observedElement ]
getUpdatedValue ()
update
val
MinVal
MaxVal
getValue ()
val
getMinimumValue ()</p>
        <p>MinVal
getMaximumValue ()</p>
        <p>MaxVal
&lt;&lt;rtFeature&gt;&gt; VerifyValue (val, MinVal, MaxVal)
[ If ( val&gt;MaxVal || val&lt;MinVal ) || time out of update message ]</p>
        <p>&lt;&lt;rtFeature&gt;&gt; notify ()
[ If ( val&gt;MaxVal || val&lt;MinVal ) || time out of update message ]</p>
        <p>&lt;&lt;rtFeature&gt;&gt; initiateCorrection ()
Fig 3. Specification of RT controller pattern dynamic view</p>
        <p>Fig 3. Specification of RT controller pattern dynamic view
4.2</p>
      </sec>
      <sec id="sec-4-2">
        <title>RT sensor pattern instantiation: an example</title>
        <p>This section proposes to illustrate the reuse of RT controller pattern through the design
of freeway traffic management system.</p>
        <p>
          The increasing road transport traffic and the incessant rise of the number of vehicles
have caused a great growth of the magnitude of traffic flows on public roads. In
consequence, freeway traffic management systems have become an important task
intended to improve safety and provide a better level of service to motorists. We
describe, in the following an example of a freeway traffic management system:
COMPASS [
          <xref ref-type="bibr" rid="ref19">19</xref>
          ]. We focus precisely on modeling the compass control data subsystem
and we explain how this design issue can be facilitated by the reuse of the RT
controller pattern.
        </p>
        <p>The current traffic state is obtained from the essential sources: inductance loop
detectors and supervision cameras. In fact, vehicle detector stations use inductance
loops to measure speeds and lengths of vehicles, traffic density (i.e. number of vehicles
in a road segment) and occupancy information. Whereas, the supervision cameras are
used to supplement and confirm the data received through the vehicle detector stations
and to provide information on local conditions which affect the traffic flow. The
processed data are then transmitted at regular time intervals to the Central Computer
System to monitor traffic and identify traffic incidents, when they occur.
Figure 4 illustrates the class diagram of the freeway traffic management system reusing
RT controller pattern. It indicates that the controller monitors two types of elements
(Road_Segment and vehicle). In addition, the Operator optional class is instantiated
since it is essential to notify the operators of any detected events in the COMPASS
system.</p>
        <p>Fig 4. Example of controller pattern instance</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5 Conclusion</title>
      <p>The design of RT applications differs from the design of classical applications. RT
applications have to guarantee that each action (transaction) meets its deadline, and that
data are used during their validity interval. Thus, it is necessary (i) to give a great
importance to RT applications design and (ii) to benefit from previous experiences of
developers by reusing the knowledge previously acquired in the design practices. For
this reason, dealing with RT domain engineering becomes a necessity since it allows to
identify reusable patterns which reduce the complexity of RT applications design.</p>
      <p>In order to represent RT design patterns in a more readable manner, this paper
proposed UML-based extensions distinguishing clearly between the different parts
constituting the pattern. These extensions help the designer in determining the variable
elements that may differ from one application to another and allows to identify, easily,
design patterns when they are applied to model a particular RT application. Besides,
this paper proposed to guide the designer in modeling features specific to RT domain
through the use of stereotypes imported from MARTE profile. These stereotypes
provide facilities to model RT applications characteristics at a high abstraction level,
being independent from the nature of tools used for the implementation of RT systems.
The paper illustrated the proposed notations through the specification of RT controller
pattern and its instantiation to design a freeway traffic management system.</p>
      <p>Our future works include two axes. Firstly, we are looking into the formalization of
RT design patterns. Secondly, we must examine how to integrate the design patterns in
the context of the model driven architecture in order to add more assistance when
generating models by reusing patterns. This could bring new benefits and impulse for
both the knowledge capturing techniques and the software development process
quality.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Gamma</surname>
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Helm</surname>
            <given-names>R.</given-names>
          </string-name>
          , Johnson R.E,
          <string-name>
            <surname>Vlissides</surname>
            <given-names>J.</given-names>
          </string-name>
          ,
          <article-title>Design patterns: Elements of Reusable Object-Oriented Software</article-title>
          ,
          <string-name>
            <surname>Addison-Wesley Edition</surname>
          </string-name>
          ,
          <year>1994</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Fowler</surname>
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Analysis Patterns - Reusable Object</surname>
            <given-names>Models</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Addison-Wesley</surname>
          </string-name>
          ,
          <year>1997</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Dong</surname>
            <given-names>J.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Yang</surname>
            <given-names>S.</given-names>
          </string-name>
          ,
          <article-title>Visualizing design patterns with a UML profile</article-title>
          ,
          <source>proceedings of IEEE Symposium on Human Centric Computing Languages and Environments</source>
          , pp:
          <fpage>123</fpage>
          -
          <lpage>125</lpage>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Arnaud</surname>
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Front</surname>
            <given-names>A.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Rieu</surname>
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Expression</surname>
          </string-name>
          et usage de la variabilité dans les patrons de conception,
          <source>Revue des sciences et technologies de l'information, série : Ingénierie des Systèmes d'Information</source>
          , vol.
          <volume>12</volume>
          /4, pp.
          <fpage>21</fpage>
          -
          <lpage>24</lpage>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Eden</surname>
            <given-names>A.H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gil</surname>
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hirshfeld</surname>
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yehudai</surname>
            <given-names>A.</given-names>
          </string-name>
          ,
          <article-title>Towards a mathematical foundation for design patterns</article-title>
          ,
          <source>Technical report</source>
          , dept.of information technology, U.Uppsala,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Mikkonen</surname>
            <given-names>T.</given-names>
          </string-name>
          ,
          <article-title>Formalizing Design Patterns</article-title>
          ,
          <source>Proc. 20th International Conference on Software Engineering- ICSE</source>
          , pp.
          <fpage>115</fpage>
          -
          <lpage>124</lpage>
          ,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7. OMG, UML
          <volume>2</volume>
          .0 OCL specification,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Bouassida</surname>
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ben-Abdallah</surname>
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Extending</surname>
            <given-names>UML</given-names>
          </string-name>
          <article-title>to guide design pattern reuse</article-title>
          , Sixth Arab International Conference On Computer Science Applications, Dubai,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9. OMG,
          <source>Unified Modeling Language (UML) Infrastructure: v2.1</source>
          .2, formal/2007-11-04,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>OMG</surname>
          </string-name>
          ,
          <article-title>A UML Profile for MARTE: Modeling and Analysis of Real-Time Embedded systems</article-title>
          ,
          <source>OMG document number: ptc/2008-06-09</source>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Ramamritham</surname>
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Real-Time Databases</surname>
          </string-name>
          .
          <source>Journal of Distributed and Parallel Databases</source>
          ,
          <volume>1</volume>
          (
          <issue>2</issue>
          ):
          <fpage>199</fpage>
          -
          <lpage>226</lpage>
          ,
          <year>1993</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Ramamritham</surname>
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Son</surname>
            <given-names>S.</given-names>
          </string-name>
          , and DiPippo L.,
          <string-name>
            <surname>Real-Time Databases</surname>
            and
            <given-names>Data</given-names>
          </string-name>
          <string-name>
            <surname>Services</surname>
          </string-name>
          .
          <source>RealTime Systems</source>
          ,
          <volume>28</volume>
          :
          <fpage>179</fpage>
          -
          <lpage>215</lpage>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Kim</surname>
            <given-names>D.K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>France</surname>
            <given-names>R.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Ghosh</surname>
            <given-names>S.,</given-names>
          </string-name>
          <article-title>A UML-based language for specifying domain-specific patterns</article-title>
          ,
          <source>Journal of Visual Languages and Computing</source>
          , pp.
          <fpage>265</fpage>
          -
          <lpage>289</lpage>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Douglass</surname>
            <given-names>B. P.</given-names>
          </string-name>
          ,
          <article-title>Real-Time Design Patterns: Robust Scalable Architecture for Real Time Systems</article-title>
          ,
          <string-name>
            <surname>Addison-Wesley</surname>
            <given-names>Edition</given-names>
          </string-name>
          ,
          <year>September 27</year>
          ,
          <year>2002</year>
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>M. Amirijoo</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Hansson</surname>
            , and
            <given-names>S. H.</given-names>
          </string-name>
          <string-name>
            <surname>Son</surname>
          </string-name>
          .
          <article-title>Specification and management of QoS in real-time databases supporting imprecise computations</article-title>
          .
          <source>IEEE Transactions on Computers</source>
          ,
          <volume>55</volume>
          (
          <issue>3</issue>
          ),
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Yacoub</surname>
            <given-names>S. M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ammar</surname>
            <given-names>H.</given-names>
          </string-name>
          ,
          <article-title>Pattern-Oriented Analysis and Design: Composing Patterns to Design Software Systems</article-title>
          , Published by
          <string-name>
            <surname>Addison-Wesley</surname>
            <given-names>Professional</given-names>
          </string-name>
          ,
          <year>August 2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Czarnecki</surname>
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Eisenecker</surname>
            <given-names>U.W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Generative</surname>
          </string-name>
          Programming - Methods, Tools, and
          <string-name>
            <surname>Applications</surname>
          </string-name>
          , Addison-Wesley,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>Reinhartz-Berger</surname>
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sturm</surname>
            <given-names>A.</given-names>
          </string-name>
          ,
          <article-title>Utilizing domain models for application design and validation</article-title>
          ,
          <source>Information and Software Technology</source>
          , vol
          <volume>51</volume>
          , pages
          <fpage>1275</fpage>
          -
          <lpage>1289</lpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>19. COMPASS Website, Available from: http://www.mto.gov.on.ca/english/traveller/compass/main.htm</mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20.
          <string-name>
            <surname>Douglass B. Real Time</surname>
            <given-names>UML</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Third</surname>
            <given-names>Edition</given-names>
          </string-name>
          :
          <article-title>Advances in The UML for Real-Time Systems</article-title>
          . Pearson Education, Inc,
          <fpage>0</fpage>
          -
          <lpage>321</lpage>
          -16076-
          <issue>2</issue>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          21.
          <string-name>
            <surname>Lanusse</surname>
            <given-names>A.</given-names>
          </string-name>
          , G´erard S., and Terrier F..
          <article-title>Real-time modeling with UML: The ACCORD approach</article-title>
          . In J. B´ezivin and P.-A. Muller, editors,
          <source>The Unified Modeling Language</source>
          , UML'
          <fpage>98</fpage>
          - Beyond the Notation. First International Workshop, Mulhouse, France,
          <year>June 1998</year>
          , Selected Papers, volume
          <volume>1618</volume>
          <source>of LNCS</source>
          , pages
          <fpage>319</fpage>
          -
          <lpage>335</lpage>
          . Springer,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          22. OMG. ”
          <article-title>UML Profile for Schedulability, Performance and Time</article-title>
          ,
          <year>v1</year>
          .1”, formal/2005-01-02,
          <year>January 2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          23.
          <string-name>
            <surname>Idoudi</surname>
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Louati</surname>
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Duvallet</surname>
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bouaziz</surname>
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sadeg</surname>
            <given-names>B.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Gargouri</surname>
            <given-names>F.</given-names>
          </string-name>
          ,
          <article-title>How to model a real-time database</article-title>
          .
          <source>Proceedings of 12th IEEE International Symposium on Object-oriented Real-time distributed Computing</source>
          (IEEE ISORC'
          <year>2009</year>
          ), Tokyo, Japan, pages
          <fpage>321</fpage>
          -
          <lpage>325</lpage>
          , March 17-20,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          24.
          <string-name>
            <surname>Port</surname>
            <given-names>D.</given-names>
          </string-name>
          ,
          <article-title>Derivation of Domain Specific Design Patterns. USC Center for software engineering</article-title>
          ,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>