Information Technology Reference
In-Depth Information
General Part Detection
For the detection of general part, the function
findSetsOfEvent
is the same as
the one used for the detection of safe part.
The function
min
is similar to the one used for the detection of safe part,
except for one difference. According to the definition of a general part, it is not
necessary to check whether
M =
M|E M . So, in the function
min
, this checking
is not performed (let us note that the property
M ⊆≤ M|E M
is always verified).
5
Operator of Composition
Now that we can detect join points in a base bSD, it remains to compose the
bSD Advice with the join points. In [18], they use the notion of strict part
to define the join points. If we note by
J
the join point and by
B
the base
bSD, by definition, there exist two bSDs
B 1 and
B 2 such that we can write
B
Ad
the advice representing the expected behavior, all you have to do to compose
the advice with the join point is to replace the join point by the advice, and the
woven bSD is
=
B 1 • J • B 2 (
being the operator of sequential composition). If we note
B 1 • Ad • B 2 .
When we use the notions of general part, safe part or enclosed part to define
the join points, the composition of the advice is not so easy. Indeed, with these
kinds of join points, some messages can surround a join point or some messages
can be present between the messages forming the join point. In these cases, it
is not possible to simply replace a join point by an advice because the result
cannot be always expressed with the standard operators of composition such as
the sequential composition operator. Therefore, we have to define a new operator
of composition which takes into account the common parts between a join point
and an advice to produce a new bSD which does not contain copies of similar
elements of the two operands. We propose an operator of composition for bSDs
called left amalgamated sum . This sum is inspired by the amalgamated sum
proposed in [17]. We add the term
B
=
left
because our operator is not commutative,
but it imposes a different role on each operand.
Figure 11 shows an example of left amalgamated sum where the two bSDs
base =( I b ,E b , ≤ b ,A b b b , ≺ b )and advice =( I a ,E a , ≤ a ,A a a a , ≺ a )are
amalgamated. For that, we use a third bSD which we call bSD
pointcut
=
(
I p ,E p , ≤ p ,A p p p , ≺ p ) and two bSD morphisms
f
:
pointcut → base
and
g
:
pointcut → advice
which allow the specification of the common parts of the
two bSDs
base
and
advice
.Moreover,
f
has to define an enclosed part, a safe
M in the bSD
part or a general part
base
such that
f
is an isomorphism from
M . We can note that the morphism
the
is automatically obtained
with the process of detection described into the previous section.
The morphism
pointcut
to
f
, which indicates the elements shared by the advice and the
pointcut, has to be specified when the aspect is defined. In this way,
g
allows
the specification of abstract or generic advices which are “instantiated” by the
morphism. For instance, it is not mandatory that the advice contains objects
having the same name as those present in the pointcut. In the three aspects
g
Search WWH ::




Custom Search