Information Technology Reference
In-Depth Information
paths on the advice map are then removed from the advice map (see crossed
out path in Fig. 18b) because no new behavior is added by empty paths. In this
example advice is only added before the pointcut and therefore only one disjoint
path exists after all empty paths are removed. If advice is added before and after
the pointcut, then several disjoint paths exist after removing all empty paths.
An in-path of the pointcut stub turns into a new end point. The mapping
for a new end point is found by following the plug-in binding of its associated
in-path to the start point on the pointcut map. The mapping of the path node
after this start point is retained (see mapping 2 in Fig. 18a and mapping 1 in
Fig. 18b). An out-path of the pointcut stub turns into a new start point. The
mapping for a new start point is found by following the plug-in binding of its
associated out-path to the end point on the pointcut map. The mapping of the
path node before this end point is retained. Note that if a pointcut stub contains
multiple pointcut maps, several mappings are retained.
In addition, the direction towards the next closest mapping is also retained
(see the large arrow called the closest-mapping arrow in Fig. 18b). The closest-
mapping arrow points towards the path node in the base model identified by the
mapping from the unnamed start or end point on the pointcut map (depending
on which plug-in binding was followed from the pointcut stub). This is especially
important for path nodes in the base map that can have more than one path
node as successor or predecessor as the following or preceding mapping clearly
identifies the successor or predecessor, respectively.
Step 2 scans the path on the advice map to find a corresponding start point
for each new end point and a corresponding end point for each new start point.
If no or more than one such start or end point can be found, the advice map is
malformed and composition cannot proceed. The path is scanned backwards for
new end points and forward for new start points. Once a start or end point is
found, the same mapping as for the corresponding new end point or new start
point, respectively, is created (see mapping 2 in Fig. 18c).
All that is left to do in step 3 is to insert the stub in the base map. The
insertion point is the one associated with the joinpoint and the one towards
which the closest-mapping arrow identified in step 1 is pointing. The inserted
stub is bound to the same component as the joinpoint (in the example in Fig. 18,
this path node is identified by the mapping in Step 1). Note that it is possible
to specify with the UCM notation whether components on a plug-in map are
contained in the component of the corresponding stub. In all presented examples,
the components on a plug-in map are not contained in the component of the stub.
Finally, the mappings are converted into plug-in bindings and thus, the aspect
has been woven into the base map. Several stubs may have to be inserted for
one advice map (e.g., if the same pointcut expression is matched successfully
against many base maps or if one pointcut stub contains multiple pointcut maps
that cause multiple successful matches). See Appendix B for more details on the
composition algorithm.
There are a number of special cases that have to be taken into account by the
composition algorithm: (a) insertion points before a start point or after an end
 
Search WWH ::




Custom Search