不过,以横切的方式提供注释是很有用的。
However, supplying annotations in a crosscutting manner can be very helpful.
请参阅参考资料来了解关于动态横切的更多内容。
在横切的世界里,横切有两种类型:动态横切和静态横切。
Within the world of crosscutting, there are two types: dynamic crosscutting and static crosscutting.
在本文剩下的篇幅中,我将重点讲解静态横切的技术和应用。
For the remainder of the article I will focus on the technique and application of static crosscutting.
概念上,这种结构可以以横切的方式在程序元素上附加注释。
Conceptually, such a construct allows you to attach annotations to program elements in a crosscutting manner.
静态横切和动态横切的区别在于它不修改一个给定对象的执行行为。
Static crosscutting differs from dynamic crosscutting in that it does not modify the execution behavior of a given object.
AOP工具的设计目标是把横切的问题(例如认证和事务管理)模块化。
AOP tools are designed to modularize crosscutting concerns, such as authentication and transaction management.
以横切的方式对待安全性关注点的真正妙处是:可以有效地重用这些关注点。
The real beauty of treating safety concerns in a crosscutting manner, however, is that you can effectively reuse them.
这些概念是动态横切的核心,虽然正如我们即将看到的,它们并不全都是静态横切所必需的。
These concepts are central to dynamic crosscutting, although as we'll see they are not all required for static crosscutting.
由于横切的问题在系统中是如此基本的一个问题,所以MDD工具会从模型化的横切结构以及生成的方面中获益。
Since crosscutting concerns are so fundamental in systems, MDD tools will benefit from modeling crosscutting structure and generating aspects.
正如前面看到的,AspectJ编辑器中的标记和CrossReferences视图清楚地在每个文件的基础上表现出了横切的特性。
As you saw earlier, markers in the AspectJ editor and cross References view clearly show you the nature of crosscutting on a per-file basis.
AOP是在应用程序开发中管理横切关注点的关键。
AOP is key to managing crosscutting concerns in application development.
在本文中,我将介绍测试用方面实现的横切行为的一组技术。
In this article, I introduce a catalog of techniques for testing crosscutting behavior implemented with aspects.
可以看出,对于将横切元素的名字分解为多个部分,使用注释很方便。
As you can see, annotations are very handy for untangling the names of crosscutting elements into multiple pieces.
即将发行的版本将与AspectJ集成,提供与精细横切机制的互操作性。
An upcoming release will integrate with AspectJ to provide interoperability with fine-grained crosscutting mechanisms.
用注解捕获应用中特定的横切关注点是一种很简单的方式。
Annotations are an easy way to capture certain crosscutting concerns in the applications.
如果程序元素的横切特性发生改变,那么它的名字和它的所有引用者都需要做相应的改变。
If a program element's crosscutting characteristics change, its name and all its referers will need to be changed accordingly.
请参阅参考资料来学习更多关于面向方面编程和其他横切技术的知识。
See Resources to learn more about aspect-oriented programming and different crosscutting techniques.
AJDT提供了两种向您展示AspectJ项目的横切特性的方法。
These are two of the ways AJDT shows you the crosscutting nature of your AspectJ projects.
横切数个类的行为给集成测试带来了一个特定问题。
Behavior that crosscuts a number of classes poses a particular problem for integration tests.
Hyperspaces超越了对横切关系的封装,并尝试管理关系的多维分离。
Hyperspaces goes beyond the encapsulation of crosscutting concerns and attempts to manage multi-dimensional separation of concerns.
所有这些都是所谓横切关注点的例子。
现在,我将展示以横切方式提供注释的基本语法。
For now, I'll show you the basic syntax to supply annotation in a crosscutting manner.
重要的是知道什么时候使用基于元数据的横切、什么时候不使用它。
The important thing is knowing where to apply metadata-based crosscutting and where to leave it out.
可是对于不能用一般方法捕获所需连接点的横切功能,这种方法存在局限性。
For crosscutting functionality that could not capture the needed join points in a generic manner, however, this approach would be limiting.
IDE支持的另外一个主要职责是让系统的横切结构易于导航和理解。
Another key responsibility of IDE support is to make the system's crosscutting structure easy to navigate and understand.
这种解决方案的另一个问题是它的横切功能不能使用,除非类通过嵌入嵌套的子方面显式“参与”协作。
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.
而AOPIDE支持使得横切结构的效果清晰可见,从而使处理某些方面就像处理对象一样容易。
AOP IDE support makes the effects of the crosscutting structure explicit, which makes working with aspects as easy as it is to work with objects.
不过,在试图对其他横切功能使用同样的方法时,它变得不可伸缩。
When you try to apply the same approach to other crosscutting functionality, however, it simply does not scale.
在编辑器中的方法内部单击会使CrossReferences视图显示该方法的横切信息,如图1所示。
Clicking within a method in the editor causes the cross References view to show any crosscutting information for that method, as illustrated in Figure 1.
应用推荐