A Graphical Representation of Dependency

Analyzing dependency and flow through a graph


Dependency Graph

Above is a dependency graph generated by the ns-dep-graph lein plugin for my Clojure Tic Tac Toe game. The colors are to show what constituted a dependency and has the wonderful legend that describes what each of the hues mean.

Based on this graph, I can’t say whether it fully follows the Dependency Inversion Principle (DIP) or not. It is sort of a mix. There are points where it does, and points where it does not. I’ll go through them.

Points where DIP holds:

Points where DIP falls apart a bit:

So, it is pretty much a mix. I’d like to think it is a pretty fair mix, but I am biased towards my own benefit. There are probably ways to invert it more so that there are more abstractions that are relied on, but I can’t think of any.