Iris Classon
Iris Classon - In Love with Code

(Not so) Stupid Question 305: What is a transitive dependency?

I’ve been in bed sick for two days, and to celebrate that I’ve finally managed to drag myself out of bed AND had a shower (winning!) I did a short ‘Stupid Question of the Day’ (as I always say, there are no stupid questions, the title/tag is meant to be sarcastic).

The other day I was discussing our architecture with a coworker and mentioned that we have problems with transitive dependencies as a direct result of our poor dependency architecture. I was asked what that meant, and we had a good discussion talking about managing dependencies in projects where you don’t control the dependency chain. As for the question ‘What is a transitive dependency?’ the answer is simple. It’s an indirect dependency.

One of our webservices depends on a business logic layer, and that layer itself has tons of dependencies. One dependency is a library called Shared (ah yes, we were young and foolish -the name pretty much indicates that we need to rethink this). That library holds a bunch of utility classes and infrastructure code (and more things, but I don’t want to make you cry). The infrastructure makes use of a third party library for serializing and derializing JSON (if you can guess which one I’ll make a Haiku for you about our code).

So we have:

Web service => Shared => JSON lib

This makes Shared a direct dependency to the web service, and the JSON lib an indirect (transitive) dependency as it is required for the Shared library. As you can imagine, the JSON library itself has dependencies, and voila you get a chain that isn’t necessarily under your control. This can cause all sorts of problems, one of them being managing versions of re-occurring dependencies. I’ll keep the question and answer short this time, but I’ll get back to this :)

Hope you enjoyed the video! I’m going back to bed now :D

Comments

Leave a comment below, or by email.
Peter Morlion
2/18/2018 1:48:59 PM
Is it JSON.NET? 


Last modified on 2018-02-16

comments powered by Disqus