Circular reference

Circular reference

A circular reference is a series of references where the last object references the first, resulting in a closed loop.

Contents

In language

A circular reference is not to be confused with the logical fallacy of a circular argument. Although a circular reference will often be unhelpful and reveal no information, such as two entries in a book index referring to each other, it is not necessarily so that a circular reference is of no use. Dictionaries, for instance, must always ultimately be a circular reference since all words in a dictionary are defined in terms of other words, but a dictionary nevertheless remains a useful reference. Sentences containing circular referents can still be meaningful;

Her brother gave her a kitten; his sister thanked him for it.

is circular but not without meaning. Indeed, it can be argued that self-reference is a necessary consequence of Aristotle's Law of non-contradiction, a fundamental philosophical axiom. In this view, without self-reference, logic and mathematics become impossible, or at least, lack usefulness.[1][2]

In business

Sometimes, improperly planned business support will result in a circular reference.

For example:

Alice needs to return her washing machine – it's defective and she needs it working. She is instructed by Bob of customer service to report to Carol of Returns and Exchanges for the requested service. Carol, however, tells Alice to report to David. David tells Alice to talk to Bob.

The entire set of references is now worthless because none of them can satisfy Alice's request; Alice has been given the run-around, every referral leads to Alice being told to refer to someone else.

In computer programming

Circular references can appear in computer programming when one piece of code requires the result from another, but that code needs the result from the first.

For example:

Function A will show the time the sun last set based on the current date. Function B will calculate the date based on the number of times the moon has orbited the earth since the last time Function B was called. So, Function B asks Function C just how many times that is. Function C doesn't know, but can figure it out by calling Function A to get the time the sun last set.

The entire set of functions is now worthless because none of them can return any useful information whatsoever. This leads to what is technically known as a livelock. It also appears in spreadsheets when two cells require each others' result. For example, if the value in Cell A1 is to be obtained by adding 5 to the value in Cell B1, and the value in Cell B1 is to be obtained by adding 3 to the value in Cell A1, no values can be computed. (Even if the specifications are A1:=B1+5 and B1:=A1-5, there is still a circular reference. It doesn't help that, for instance, A1=3 and B1=-2 would satisfy both formulas, as there are infinitely many other possible values of A1 and B1 that can satisfy both instances.)

A circular reference represents a big problem in computing. A deadlock occurs when two or more processes are each waiting for another to release a resource. Most relational databases such as Oracle and SQL Server do not allow circular referencing because there is always a problem when deleting a row from a table having dependencies to another row from another table (foreign key) which refers to the row being deleted. From the technical documentation at Microsoft: The FOREIGN KEY constraints cannot be used to create a self-referencing or circular FOREIGN KEY constraint.[3] Only inner joins are supported and are specified by a comparison of columns from different tables. Circular joins are not supported. A circular join is a SQL query that links three or more tables together into a circuit.[4] Oracle uses the term Cyclic to designate a circular reference.[5]

A distinction should be made with processes containing a circular reference between those that are incomputable and those that are an iterative calculation with a final output. The latter may fail in spreadsheets not equipped to handle them but are nevertheless still logically valid.[2]

Circular references in spreadsheets

Circular reference in worksheets can be a very useful technique for solving implicit equations such as the Colebrook equation and many others, which might otherwise require tedious Newton-Raphson algorithms in VBA or use of macros.[6]

References

See also


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • circular reference — ciklinė nuoroda statusas T sritis informatika apibrėžtis ↑Nuoroda, per kurią susidaro nuorodų ratas (ciklas). Tai nuoroda, nukreipianti į save tiesiogiai arba netiesiogiai – per kitą (kitas) nuorodą (nuorodas). Ciklinės nuorodos atsiranda… …   Enciklopedinis kompiuterijos žodynas

  • circular reference — error in an electronic spreadsheet in which several cells have references to one another …   English contemporary dictionary

  • Circular — is a basic geometric shape such as a Circle. Contents 1 Documents 2 Travel and transportation 3 Places …   Wikipedia

  • Circular definition — A circular definition is one that uses the term(s) being defined as a part of the definition or assumes a prior understanding of the term being defined. Either the audience must already know the meaning of the key term(s), or the definition is… …   Wikipedia

  • Circular journey — Circular Ticket AF ET(via AGC) CBE MAQ CLT ERS TVC SBC SC AGC A circular journey is an excursion in which the final destination is the same as the starting point. A traveler who wishes to go on a pilgrimage or sightseeing trip to many… …   Wikipedia

  • Circular dichroism — (CD) refers to the differential absorption of left and right circularly polarized light.[1][2] This phenomenon was discovered by Jean Baptiste Biot, Augustin Fresnel, and Aimé Cotton in the first half of the 19th century.[3] It is exhibited in… …   Wikipedia

  • Circular chess — Modern Circular Chess Years active 10th century AD to present Genre(s) Abstract strategy games, Chess variants Players 2 Setup tim …   Wikipedia

  • Circular stingaree — Conservation status Least Concern (IUCN 3.1)[1] …   Wikipedia

  • Circular motion — Classical mechanics Newton s Second Law History of classical mechanics  …   Wikipedia

  • Circular flow of income — In this simplified image, the relationship between the decision makers in the circular flow model is shown. Larger arrows show primary factors, whilst the red smaller arrows show subsequent or secondary factors. In economics, the terms circular… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”