user2725109
user2725109

Reputation: 2386

Multiple Versions Problem for Releasable Components with Acyclic Dependencies

In his great book, Clean Architecture, Robert Martin suggests partitioning the development environment into releasable components (or packages) that satisfy the Acyclic Dependencies Principal (ADP). As new releases of a component are made available, other teams can decide whether or not to incorporate the new release or not. Thus each team can work independently.

There is a remaining issue though. Consider the following dependency situation:

Thus component A depends on component B version 1.* and B version 2.*. This poses a problem and in a way couples back the components together. For example, you have to update the dependency of your component and the dependency of any component in between. What are some approaches for resolving this situation?

Upvotes: 0

Views: 38

Answers (1)

Adrian K
Adrian K

Reputation: 10215

Disclaimer - I know nothing of C++ so this is all generic advice.

As I understand it, off the top of my head, .Net gets around this problem by letting each component have it's own copy of it's dependencies - so they are completely isolated. Otherwise it's "DLL hell".

To use OO as a metaphor, all the components that A and C depend on would be private members, and visible only to them internally - not externally. Comp A, which depends on Comp C doesn't care what dependencies C has.

Alternatively, if you can't have isolated dependencies then you need to look at strategies for using abstraction. Abstraction - use of dependency inversion, etc - would provide you some control over which implementation (i.e. which version) of a dependency gets used at runtime.

Alternatively, if possible, get teams to co-ordinate on which versions of shared dependencies they are going to use.

Alternative - but a fairly heinous one - be backwards compatible.

Upvotes: 1

Related Questions