Acyclic Dependencies Principle
Get Acyclic Dependencies Principle essential facts below. View Videos or join the Acyclic Dependencies Principle discussion. Add Acyclic Dependencies Principle to your PopFlock.com topic list for future reference or share this resource on social media.
Acyclic Dependencies Principle

The acyclic dependencies principle (ADP) is a software design principle that states that "the dependency graph of packages or components should have no cycles".[1] This implies that the dependencies form a directed acyclic graph.

Example

Circular dependency example

In this UML package diagram, package A depends on packages B and C. Package B in turn depends on package D, which depends on package C, which in turn depends on package B. The latter three dependencies create a cycle, which must be broken in order to adhere to the acyclic dependencies principle.[2]

Types of dependencies

Software dependencies can either be explicit or implicit. Examples of explicit dependencies includes:

  • Include statements, such as #include in C/C++, using in C# and import in Java.
  • Dependencies stated in the build system (e.g. dependency tags in Maven configuration).

Examples of implicit dependencies includes:[3]

In general, it's considered good practice to prefer explicit dependencies whenever possible. This is because explicit dependencies are easier to map and analyze than implicit dependencies.

Cycle breaking strategies

It is in general always possible to break a cyclic dependency chain. The two most common strategies are:[1]

See also

References

  1. ^ a b "Granularity: Acyclic dependencies principle (ADP)" (PDF). Object Mentor. Retrieved .
  2. ^ Fowler, Martin (2004). UML Distilled.
  3. ^ "Implicit Dependencies Are also Dependencies". O'Reilly. Archived from the original on 2013-05-25. Retrieved .

  This article uses material from the Wikipedia page available here. It is released under the Creative Commons Attribution-Share-Alike License 3.0.

Acyclic_dependencies_principle
 



 



 
Music Scenes