Information Technology Reference
In-Depth Information
point and (b) around advice. Figure 7 shows that insertion points exist before a
start point or after an end point. These insertion points are required for named
start or end points on a pointcut map which are matched against start or end
points in the base map, respectively. At step 1 of the composition algorithm,
named start points or named end points in pointcut maps receive special treat-
ment when establishing the closest-mapping arrow. The closest-mapping arrow
of a start point in the base map that is mapped to a named start point in the
pointcut map always points to the insertion point before the start point. The
closest-mapping arrow of an end point in the base map that is mapped to a
named end point in the pointcut map always points to the insertion point after
the end point. Consequently, a stub has to be inserted in the base map either
before the mapped start point or after the mapped end point. A stub, however,
cannot be simply inserted before a start point or after an end point. Additional
start and end points are required as illustrated in Fig. 19 (see s1 , e1 , s2 ,and
e2 ). Note that any plug-in bindings of the mapped start or end point have to be
transferred to the new start or end point, respectively (e.g., from abc to s1 or
xyz to e2 in Fig. 19).
Base Map
Composed Map
abc
xyz
abc
xyz
A
A
s1
e1
s2
e2
no
Pointcut Map
abc
xyz
Fig. 19. Composition with named start and end points
The second special case involves around advice. Figure 20 introduces a new
feature for the reservation example. Instead of using a waiting list, a reservation
at a partner hotel is attempted and the reservation is added to the waiting list
only if the reservation at the partner hotel also fails. In terms of the composition
algorithm, the only differences to the example in Fig. 18 occur at steps 1 and 3.
In step 1, the composition algorithm notices that both, a new start point and a
new end point, exist in one path on the advice map (see s1 and e1 in Fig. 20b).
This indicates around advice. Because of that, the stubs inserted into the base
mapinstep3aremarkedwith A
in order to highlight that the path
segment between the two stubs may be skipped. In the example in Fig. 20, this
occurs if the reservation at the partner hotel is successful. The stubs A
and A
and
A
represent the entrance and exit of a tunnel underneath the base map that
can be used to circumvent the path segment between the two stubs.
The around advice in Fig. 20 is a weak kind of around advice as the base
behavior is not overridden all the time by the aspect. Strong around advice can
be indicated even more clearly. Let us assume that the topic with hotel partner
feature is replacing the waiting list behavior. This is certainly not good customer
service but let us ignore this for one moment for the sake of this example. Then,
Search WWH ::




Custom Search