Information Technology Reference
In-Depth Information
with the Eclipse Modeling Framework (EMF) [5] which allows us to use Eclipse
tools to edit, store, and visualize models.
6.2
The Weaving Process as Model Transformations
As detailed previously, the weaving process consists of two steps. Firstly, the
detection step uses the pointcut model and the base model to compute a set of
join points. Each join point is characterized by a morphism from the pointcut to
a corresponding elements in the base model. Secondly, using these morphisms,
the advice is composed with each join point in the base model. The first step
processes models to extract join points and the second is a model transformation.
Fig. 12 details the input and output models of these two steps (each ellipse
is a model and the black rectangle on the top left-hand corner indicates its
metamodel). Except for morphisms, all models are SDs.
The first step to process or transform models in Kermeta is the definition of
the input and output metamodels. Thanks to the compatibility of Kermeta with
Eclipse tools, we have used Omondo UML [22] which provides a graphical editor
for metamodels in addition to UML editors. Fig. 3 presents the simple metamodels
we are using for SDs. We use this sequence diagram metamodel rather than that of
UML2.0 for two major reasons. Firstly, as shown in Sect. 2, the metamodel in Fig.
3 fits very well with the formal definitions introduced in this paper. So, the meta-
model is relatively small, concise and easy to understand, and the algorithms pre-
sented in this paper are easier to write with this metamodel rather than with that
of UML2.0. Secondly, it is very simple to write a transformation from the UML2.0
sequence diagram metamodel to the metamodel in Fig. 3 because the concepts are
very close. So, we can apply the weaving on a model compliant to the UML2.0 meta-
model by performing a transformation from the UML2.0 sequence diagram meta-
model to the metamodel in Fig. 3 before the weaving process.
Once the metamodel is defined this way, EMF provides generic tools to cre-
ate, edit and save instance models. Kermeta allows, on one hand to complete the
metamodel with the specification of the bodies of operation and on the other
hand to process models created with EMF. We used the same process to de-
fine a simple metamodel to represent morphisms. This metamodel contains only
one class called Morphism which encapsulates associations between, instances,
messages and events of two SDs.
Using the metamodels for SDs and morphisms, we have designed and imple-
mented the complete weaving process. For the detection transformation we have
defined a Kermeta abstract class Detection and three sub-classes to implement
the different detection strategies. The composition is implemented in a single
Kermeta class.
Both the implementation of detection algorithms and the implementation
of the composition operator were used to validate the techniques proposed in
this paper. The composition was implemented first and tested by providing test
cases composed of a base scenario, a pointcut scenario, an aspect scenario, and
the morphisms between the pointcut and the advice and between the pointcut
and the base scenario. We chose the set of test cases to intuitively cover the
 
Search WWH ::




Custom Search