Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Organizing complex multi module aspectj projects

Hello all,
I'm searching for a good strategy or a best practice for organizing
complex multi module projects with aspectj. What I'm talking about is a
complex system, in which there is, for example, a core module containing
domain beans, then a module containing persistence with aspects that
advice methods in the core module, then a module containing security
that also advices the core module, but since it uses some persistence is
also adviced by the persistence module, then a module for tracing that
advices all the other modules .. and so on.

The problem is that, while it is simple to have all this stuff in a
single source folder and get all compiled and weaved at once, it is much
more problematic to have each module build by itself, be packaged in a
jar, opened in eclipse and so on.

I'm not talking about dependency management, we use maven so no problem
on that side, but how to conceptually organize them to avoid problems
like double weaving and to obtain best modularity.

The main problem I see is the need to specify (both in AJDT and in the
maven aspectj mojo) which aspects are used on which dependencies. On the
eclipse side this is a pain since it is quite easy to apply the same
aspects twice to the same target just because there are currently two
projects opened that uses the same aspects and the same dependency. Both
in eclipse and in maven, this information is lost on dependencies, so
you have to KNOW that a certain module is expected to advice a certain
other module, and configure your AspectJ build path / maven aspectj mojo
accordingly .. which is error prone and requires a lot of information
sharing which could be avoided.

Are there any best practices or tips? Can anyone point me to any
resource on this subject?

Thanks in advance,

Back to the top