Precedence Order

As shown in Figure 8, since multiple actions can be triggered at the same join point and if more than one such actions are of the same type, we need default precedence rules for the actions:

In Figure 8a, multiple actions are targeting a single $call$ join point. The weaving points for a join point in the source code are shown in Figure 8b. All the $before$ actions are woven just before the join point in order they are specified. All the $after$ actions are woven just after the join point. The call to foo is replaced by the call to the first $around$ action, which in turn can call the second $around$ action through its $proceed$ function, and so on.

Figure 8: Actions Precedence Order
[Actions List]\includegraphics[width=0.3\textwidth]{images/actions.eps} [Weaving Order]\includegraphics[width=0.5\textwidth]{images/weaved.eps}

An important point to notice here is that the default ordering rules of AspectMatlab are simpler and more restrictive than the precedence rules of AspectJ [1]. However, our action weaving strategy avoids complicated dependency rules, will not lead to any dependency cycles between actions, and is easy to comprehend from a scientific programmer's point of view. Since our actions have names, it would also be simple for us to introduce a declaration to over-ride the default ordering within each of the around, before and after groups.

Toheed ASLAM 2010-04-24