bidirectional dependencies in AOP-like languages?

Stephan Herrmann stephan.herrmann at
Tue May 9 17:19:56 UTC 2017

Over in jpms-spec-experts I still see discussion about #CyclicDependences,
which made me wonder (admittedly late), what will be the solution for
AOP-like languages which inherently need bidirectional dependencies?

Is it correct that at runtime cycles pose no problems?

Let's assume a language using Instrumentation & ClassFileTransformer for
weaving an aspect into its base.
Lets assume the aspect statically declares a dependence on that base.
Now the weaver needs to make the aspect accessible for base-to-aspect calls,
i.e., insert a dependency inverse to the existing one.

Has anybody tested, whether Instrumentation.redefineModule() works for
this kind of use case? Are there any caveats? Better approaches?

Is it right that a strategy using compile-time weaving
(rather than load time weaving and reflection)
will not work in a modular application (due to #CyclicDependences)?


More information about the jigsaw-dev mailing list