Say I have: class A depends on class B depends on class C depends on class A.
It seems impossible to compile. I have read this post about disabling compile-time depedency-checking, but all my classes are within the classpath, well-defined, etc. The only problem is that they mutually depend on each other.
Is there a way to write such an application that would compile without a hitch?
We do have several such dependency cycles in our legacy codebase and they do compile without a hitch.
This is not to say it is good to have cyclic dependencies – on the contrary. I intend to get rid of them eventually to clean up our architecture. Nevertheless, in the meantime, the code still compiles and works.