Circular reference

from Wikipedia, the free encyclopedia
Circular reference in a graph (marked in color)

A circular reference exists when, in a series of references, references or references, an object further back refers to a previous one, so that a closed loop is created. Generally, such cause circular dependencies often dilemmas that in computer science as deadlocks (for English: jamming ), respectively.

General

Circular references are not always problematic, but in many cases they lead to contradictions or unsolvable problems (see, for example, antinomy or holding problem ).

For example, it is not a problem to establish a mutual reference between two neighbors X and Y in the sense of “X is right neighbor of Y” and “Y is left neighbor of X”, provided that either X or Y can be given independently of this referencing .

Cases in which the reference only has a reference that points back to itself as the ultimate goal are problematic. The mutual assignment of values ​​to the objects is also problematic. The self-reference can be considered as a special case of circular reference in some respects.

Formal logic

A case of mutual determination of the value of an object by the other is given in the card paradox , for example , or in the variant of Russell's antinomy ( nested sets ). Circular references can be avoided through strict hierarchies that prohibit or even prevent back references. A circular reference, however, is not the same as a circular reason , since here the assignment of truth values ​​to objects is not made via the reference, but rather through inference rules.

Graph theory

In graph theory there is a circular dependency if and only if there is a cycle in a directed graph .

Computer science

Circular references are also technically relevant in computer science , as is the case with the Diamond problem , or when the database objects in a relational database relate to one another, so that the state of the dependent data depends on the order in which they are recorded, so the data are not subsequently clearly defined.

Programming interfaces

If two programming interfaces refer to each other, the compiler cannot reliably check without additional effort whether there are any logical contradictions. Circular references, for example, often lead to additional work in managing the data and program parts or even to programming errors . In the C programming language there are control files with the file extension ".h". A control file can now contain further control files. If the "Ah" file includes the "Bh" file and the "Bh" file includes the "Ch" file, everything is initially OK. If, however, the “Ch” file now includes the “Ah” file, there is a circular dependency that the compiler may not be able to resolve or may not even be noticed and taken into account.

Software components

In software development, there is a circular dependency when a component A depends on a component B (A → B) and component B in turn depends on component A (B → A). The dependency does not have to be direct, but can also be formed indirectly (via the reflexive-transitive envelope ), i.e. when A is dependent on B (A → B) and B is dependent on C (B → C) and C. again depends on A (C → A) so there is a circular relation between A and C (A ↔ C).

media

Circular relationship between Wikipedia and the press, based on a graphic from the satirical magazine Titanic

If a report is not checked by research from the original source, but is adopted, it can repeatedly become a report with reference to previous instances of reporting, even if it is a duck . This pattern can form the basis of a hoax .

Individual evidence

  1. Scott Owens: Compile-time Information in Software Components , in particular Chapter 2.3.1 Diamond Imports and Chapter 4.1.3 Compilation Management , dissertation, University of Utah (May 2007), accessed on May 18, 2018
  2. TITANIC Infographic , Startcartoon, December 2008, titanic-magazin.de