如何定义哪些方面应该融入到我的项目中,哪些方面不应该融入到 AspectJ 中?
假设我有一个抽象方面,它将用作其他 5 个方面的母方面。
一般来说,我只想将其中一两个方面融入到我的项目中。有时我希望将它们全部融入到我的项目中,有时我不想将任何方面融入到我的项目中。
完成这样的事情最简单的方法是什么?
Let's say I have an abstract aspect that is going to be used as a mother aspect for other 5 aspects.
Generally, I'll want to only have one or two of those aspects weaved into my project. Other times I'll want to have them ALL weaved into my project, and other times I'll want no aspect weaved into my project.
What is the easiest way to accomplish something like this?
您可以定义 aop.xml 文件并提供它们以包含您想要编织的方面,并使用 -xmlConfigured 选项将它们提供给编译器。
You can define aop.xml files and supply them to include the aspects you want to be woven in and supply those to the compiler using -xmlConfigured option.