Circular dependency

A circular dependency (also called " interdependence " ) can occur anywhere where different elements are interdependent, the software components or steps be. In general, cyclic dependencies often lead to dilemmas or deadlocks ( deadlocks ).

Software Development

In software development, there is a circular dependency ago when a component A of a component B depends on ( A → B ) and component B, in turn, of component A ( B → A). The dependency must not be direct, but may also be formed indirectly (via the reflexive - transitive closure ), that is, for example, if A is dependent dependent on B ( A → B ) and B is C ( B → C ) and C in turn depends on A ( C → A) so A and C are circular dependent on each other (A ↔ C).

Such dependencies can lead to big problems, as the following example shows.

In the C programming language, there are include files ( usually they end up on. " H"). Now, an include file can contain other include files. If file "Ah," the file " Bh " slipstreams and the file " Bh " integrates the file " Ch" is still all right. Now, if the file " Ch" integrates the file " Ah," a circular dependency is created. The compiler, it is impossible to compile this, because it " runs in a circle".

Graph Theory

In graph theory, a circular dependency is present precisely when in a directed graph, a cycle is present.

Steps

Another ( fictional ) example from the " daily life " shows how circular dependencies can block processes:

In order to obtain a residence permit, the alien must prove a job. He is however set by a company, it consumes a registered residence. But to be accepted by the landlord, he needs a residence permit. This closes the circle. As long as the circular dependency is not broken, he is in the country can not live permanently.

  • Graph Theory
  • Software Engineering
836858
de