Information Technology Reference
In-Depth Information
the quality of derived Smart-Home systems. The source code
in Listing 6.4 corresponds to the method we created to turn on
the air conditioning located in a particular room.
1
2
3
4
5
6
7
8
9
10
11
" DEFINE implementation FOR componentsMetamodel :: Component "
public void start(Integer floorId , Integer roomId)
throws Exception {
Room room = getRoom( floorId, roomId);
if(room != null && room.getEnvironmentalControl() ==
TypeEnvironmentalControl.AIRCONDITIONING) {
room . setAirConditionStatus(true);
}
}
" ENDDEFINE "
Listing 6.4. Model-to-text transformation rule to transform Component
elements into Java source code
6.5.2. Decision models creation
The decision is the main piece for running the production
chain. This section explains how to create it and illustrates
this with the Smart-Home example.
6.5.2.1. The decision models editor
We built an Eclipse plug-in to create decision models, the
Decision Models Editor . This editor was developed using the
Topcased facility to create model editors (see section 3.5) and
is part of the contributions of the Master thesis of Andrés
Romero [ROM 09].
Figure 6.15 presents the GUI of our Decision
Models Editor. On the left, we present the palette of
options to create Model-to-Model and Model-to-Text
transformations, Base and Specific transformation rules,
Aspects , Execution Conditions , CoarseConditions
and FineConditions . Options also include the definition of
the Source and Target models of the model transformations.
On the right, we present part of the decision model created for
our SPL of Smart-Home systems.
Search WWH ::




Custom Search