encyclopegia.org

Circular dependency

In software engineering, a circular dependency (or cyclic dependency) is a relation between two or more modules which either directly or indirectly depend on each other to function properly. Such modules are also known as mutually recursive.

In software engineering, a circular dependency (or cyclic dependency) is a relation between two or more modules which either directly or indirectly depend on each other to function properly. Such modules are also known as mutually recursive. ==Overview== Circular dependencies are natural in many domain models where certain objects of the same domain depend on each other. However, in software design, circular dependencies between larger software modules are considered an anti-pattern because of their negative effects. Despite this, such circular (or cyclic) dependencies have been found to be widespread among the source files of real-world software. Mutually recursive modules are, however, somewhat common in functional programming, where inductive and recursive definitions are often encouraged. ==Problems== Circular dependencies can cause many unwanted effects in software programs. Most problematic from a software design point of view is the tight coupling of the mutually dependent modules which reduces or makes impossible the separate re-use of a single module. Circular dependencies can cause a domino effect when a small local change in one module spreads into other modules and has unwanted global effects (program errors, compile errors). Circular dependencies can also result in infinite recursions or other unexpected failures. Circular dependencies may also cause memory leaks by preventing certain automatic garbage collectors (those that use reference counting) from deallocating unused objects. ==Causes and solutions== In very large software designs, software engineers may lose the context and inadvertently introduce circular dependencies. There are tools to analyze software and find unwanted circular dependencies. Circular dependencies can be introduced when implementing callback functionality. This can be avoided by applying design patterns like the observer pattern. ==References==

References

No reference rows published for this article.

Cite this article

MLA

"Circular dependency." encyclopegia.org, 2025, https://encyclopegia.org/wiki/circular-dependency. Accessed 25 November 2026.

Chicago

"Circular dependency." encyclopegia.org. Accessed November 25, 2026. https://encyclopegia.org/wiki/circular-dependency.

APA

encyclopegia.org. (2025). Circular dependency. Retrieved November 25, 2026, from https://encyclopegia.org/wiki/circular-dependency

Accessed November 25, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

dependency

stub · references available

circular economy

stub · references available

circular error probable

stub · references available

Central Circular Route

stub · references available

circular migration

stub · references available

circular buffer

stub · references available

circular flow of income

stub · references available

Circular rampart of Burg

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1303252600 · 0.5 · snapshot enwiki-001303252600

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.