Circular reference

From Wikipedia, the free encyclopedia

A circular reference, or sometimes known as a run-around by some people, is a series of references where the last object references the first, thus causing the whole series of references to be unusable.

Contents

[edit] Circular references in business

Often, improperly planned business support will result in a circular reference. This is known as a run-around.

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; they have been told to refer to someone else.

[edit] Circular references 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 given -- you guessed it -- 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 deadlock. It also appears in spreadsheets when two cells require each others' result. For example, when the value in Cell A1 is equal to the value in Cell B1 plus 5, and the value in Cell B1 is equal to the value in Cell A1 plus 5.

[edit] Circular reference as an explanation

A circular reference happens when a person tries to explain or prove something based on what it is they are already talking about. For example, a person trying to prove the reliability of what is written in a book by referencing something written elsewhere in the same book.

In some cases, circular references can be found in technical documentations and dictionaries. This leads to confusions and sometimes also lower productivity in solving the problem at hand than not having the documentation as a reference.

[edit] See also