Information Technology Reference
In-Depth Information
the previous definitions of bSD and cSD. In Fig. 3, we can note that cSD has an
automata structure, in that a cSD contains a set of nodes and a set of transitions
which are linked to bSDs. In this way, cSD can compose bSDs through sequences,
alternatives and loops. We can also note that a bSD contains a set of objects
(class Instance), a set of events (class Event) and a partial order on the events.
The partial order is built with the class EventCouple which orders two events:
the event “prec” precedes the event “succ”. A set of pairs of events (
)
forms the partial order. The class Event is linked to the class Instance. In this
way, we obtain the mapping
prec, succ
of Definition 1. Finally, the class Event contains
an attribute “action” which represents the message name (with this attribute,
we easily obtain the mapping
φ
α
of Definition 1).
2.2
Behavioral Aspects
We define a behavioral aspect as a pair
is a pointcut, i.e.
a bSD interpreted as a predicate over the semantics of a base model satisfied by
all join points.
A
=(
P, Ad
) of bSDs.
P
Ad
is an advice, i.e. the new behavior that should replace the base
behavior when it is matched by
P
. Similarly to AspectJ, where an aspect can
be inserted “around”, “before” or “after” a join point, we will show in the next
sections that an advice may equally complete the matched behavior, replace it
with a new behavior, or remove it entirely.
When we define aspects with sequence diagrams, we keep some advantages
related to sequence diagrams. In particular, it is easy to express a pointcut
as a sequence of messages. Figure 4 shows three behavioral aspects. The first
allows the persistence of exchanges between the customer and the server. In the
definition of the pointcut, we use regular expressions to easily express three kinds
of exchanges that we want to save (the message
log in
followed by either the
message
). The second aspect allows
the identification of a log in which fails. The third aspect allows the addition of
a display and its update.
ok
, the message
try again
, or the message
no
Fig. 4. Three behavioral aspects
 
Search WWH ::




Custom Search