While it's an improvement, this design still leaves us with an N-to-1 dependency between the subaspect and classes.
虽然有了改进,但是这种设计仍然是一个子方面与类之间的 N 对 一依赖关系。
By collaborating through annotations, the participation responsibility is shifted to individual methods (instead of a participant subaspect).
通过借助注释的合作,参与责任被转移给了每个方法(而不是参与者子方面)。
With a metadata-based subaspect, when a join point in a class changes its characteristics only the annotation for the join point needs to be changed.
利用基于元数据的子方面,当类中的连接点改变其特性时,只有这个连接点的注释需要改变。
Instead of using one subaspect for my whole system, I can use many subaspects -- one per subsystem -- making it possible to write a relatively stable pointcut.
不是在整个系统中使用一个子方面,而是使用许多子方面 ——每个子系统一个子方面,这使得编写相对稳定的切入点成为可能。
Another issue with this solution is that its crosscutting functionality won't apply unless the classes explicitly "participate" in the collaboration, by embedding a nested subaspect.
这种解决方案的另一个问题是它的横切功能不能使用,除非类通过嵌入嵌套的子方面显式“参与”协作。
Another issue with this solution is that its crosscutting functionality won't apply unless the classes explicitly "participate" in the collaboration, by embedding a nested subaspect.
这种解决方案的另一个问题是它的横切功能不能使用,除非类通过嵌入嵌套的子方面显式“参与”协作。
应用推荐