jargon

Design patterns·The named ways it goes wrong

two modules import each other, and which one is initialised first decides whether it works.

Circular dependency

Also calleddependency cycle, cyclic dependency, import cycle

Two or more components that depend on each other, directly or through a chain, so neither can be understood, built, tested or deployed without the other. It shows up as an import error, a null field during initialisation or a constructor that cannot be satisfied. The usual cure is to find the concept both of them actually need and extract it, or to invert one direction with an interface owned by the depender.

Commonly confused with