Viewing C++ Project Cohesion (Code Zone Diagrams)
Have you ever wanted to view hundreds or thousands of classes of a project
at one time and their dependencies on each other? Traditional class diagrams
can show in the tens of classes, but often times these diagrams make it
difficult to understand relationships quickly.
A different way of viewing these classes is to use a circle diagram
where all of the classes are a single point on the circle. The classes are
grouped by directories. The dependencies are displayed as lines between
the classes. The lines are colored by the provider directory.
This first example shows the small Oovcde project that uses CLang to parse C++
and create these diagrams, but what if we need to display a million line project
such as LLVM? Showing lines between all classes is too much, so only lines
between directories are displayed where the classes are related. The
arrows can be turned on to indicate dependency direction. The following
diagram is the same project as the diagram above, but only shows class
dependencies between directories.
This makes it easier to see that oovcde and oovEdit are both related to
oovGuiCommon, and oovCommon, but the other components are not.
Another way to view the classes is to display each directory as a
separate circle diagram. This is the same information as the first
diagram, but is only laid out differently.