This one goes out to the listener in France that doubted my word that you can take tangle-free classes and create tangles by careless packaging. It prompted me to dig out a sequence of diagrams that nicely show how this happens.
We start with a set of code items on the left (maybe classes) with a nice DAG dependency structure and group them into 3 higher-level items on the right (like packages). And we do it in such a way that the resulting high-level dependency graph (the 3 higher-level nodes) is also a DAG.
Next we take the left-most red item and move it over to the group of green items. The resulting high-level graph is still acyclic, but it’s not quite as “nice” – there’s now an additional high-level dependency (from the red group to the green group), plus the green group includes an item that has no dependencies with the other greens.
Finally we take one of the blues and move it in with the greens and bingo, we’ve gone from nice and tidy to a full-blown, category 5 tangle in just 2 moves. Each high-level item now needs both of the other 2 for testing, deploying and re-using. Worse than that, the developers now have no sense of any intended "design" and so the code will probably become increasingly complex as they become more frustrated.
It seems kind of obvious when you can see the dependencies. But of course we usually can’t see them so we end up with "industry norm" – tangled package dependencies like the ones in this Structure101 snag of a package dependency graph.
2 Comments
Joe Drumgoole
Chris, can you make those icons a bit smaller 🙂
Chris Chedgey
Sorry Joe, we can’t keep making the icons smaller every time you get a new pair of specs! 😉