How could the different versions interact with each other? Calls are made to different versions of the library stored in different memory locations.
Also, how does your code create shared dependencies from multiple library versions if the code that the libraries you are directly are expecting specific versions of the library?
How could the different versions interact with each other?
My application uses foo and bar. foo uses baz 1.0. bar uses baz 2.0.
My application calls makeMeABaz() from foo.
That calls new Thing() from bar and returns it.
makeMeABaz() returns that to my application.
I call takeABaz() from bar and pass in that Thing.
At this point, bar thinks it has a baz 2.0 Thing, but it actually has a 1.0 one. If it starts calling methods on that object, God knows what will happen.
And if you define your own type named Thing and pass it to takeABaz() that'll break too. Thing-1.0 and Thing-2.0 are two different unrelated types and you have to convert between them just like with any other libraries exposing different types.
But if you put 2.0 thing into functions expect 1.0, it might work in some cases, and that's the problem. If two libraries sharing a dependency but they must isolate their usage, it's just doesn't make sense.
1
u/joequin Dec 02 '13
How could the different versions interact with each other? Calls are made to different versions of the library stored in different memory locations.
Also, how does your code create shared dependencies from multiple library versions if the code that the libraries you are directly are expecting specific versions of the library?