Package Cycle


Rationale: Ideally, the package structure of a software system should form a hierarchical structure. A cycle among packages reduces the understandability and maintainability of a system.  

Description: Given two packages Pa, Pb, there exists a file f1 in Pa and a file f2 in Pb. Given another file fj in Pb and fi in Pa, if f1 depends on fj, and f2 depends on fi, we consider these two packages to create a Package Cycle. 

Visualization: In a DSM, the dependencies that form cycles among packages can be shown as symmetric, non-empty cells between packages as shown below:

 

Fig.: An example of Package Cycle: the two files causes the two packages to form cyclical dependencies. 

dp: depend

The above figure presents an instance of Package Cycle, in which AvroOutputFormat.java in package mapred depends on HadoopCodecFactory.java in package file, and SortedKeyValueFile.java in package file depends on FsInput.java in package mapred, forming a dependency cycle between package mapred and package file.

To visualize an instance of Package Cycle using DV8 Explorer, select "Analysis-> Load Issue File", and choose a ".dv8-issue" file.  For a Package Cycle instance, DV8 will automatically cluster the system based on namespaces and arrange the packages so that file dependencies that form package cycles are manifested, as shown above.