"Graham St Jack" <[email protected]> wrote in message news:[email protected]... > > My own solution to this "problem" is to never have circular imports at > all. The build system I use prohibits them, so any careless introduction > of a circularity is spotted immediately and I refactor the code to > eliminate the circularity. I have never come across a valid need for > circularities, and have never had any trouble eliminating any that creep > in. > > Avoiding circularities has plenty of advantages, like progressive > development, testing and integration. On bigger projects these advantages > are very important, and even on small ones they are useful. >
That's certainly good in many cases, but I find there are many times when a "one-way" dependency graph just doesn't fit the given problem and causes more trouble than it solves. You often end up needing to re-invent the wheel to avoid a dependency, or split/arrange/merge modules in confusing unintuitive ways that have more to do with implementation detail than high-level purpose.
