Precondition tests are handled by before advice, which is executed just before the corresponding method execution join point.
前置条件测试由before建议处理,该建议就在对应的方法执行连接点之前执行。
The downside is loss of conciseness, as can be seen from the additional call to proceed with the original method invocation visible in Figure 4, which would not be necessary with a before advice.
不好的一面是它损失了简洁性,这一点可以从需要进行额外的调用才能继续执行原来的方法调用(如图4所示)看得出来,而如果用before进行通知,这一点就是不必要的。
Listing 1 shows an example of an aspect class defining a pair of methods intended to be used as before-and-after advice on a method call.
清单1显示了一个aspect类的例子,它定义了在方法调用上,将被用作前advice和后advice的两个方法。
Listing 1 shows an example of an aspect class defining a pair of methods intended to be used as before-and-after advice on a method call.
清单1显示了一个aspect类的例子,它定义了在方法调用上,将被用作前advice和后advice的两个方法。
应用推荐