You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a dependency diagram as such in my application. I want to use the containerModule api of inversify to load my dependencies.
The dependency is from A -> B and C -> B. However, inversify does not allow for 'duplicate bindings'.
Suppose module D(the top level module) depends on Module A and C, then I would try to build the dependency graph from the bottom up starting from B -> (A + C) -> D. However, If I load containerModule B from containerModule A and containerModule C, and proceed to load containerModule A and containerModule C in containerModule D, I would have ambiguous bindings when I try to resolve my dependencies in in containerModule D because I would have loaded B dependencies twice in A and C.
What would be a best practice for dealing with such a situation ? I believe it would be quite common in OO applications.
The text was updated successfully, but these errors were encountered:
I have a dependency diagram as such in my application. I want to use the
containerModule
api of inversify to load my dependencies.The dependency is from
A -> B
andC -> B
. However, inversify does not allow for 'duplicate bindings'.Suppose module
D
(the top level module) depends onModule A and C
, then I would try to build the dependency graph from the bottom up starting fromB -> (A + C) -> D
. However, If I loadcontainerModule B
fromcontainerModule A
andcontainerModule C
, and proceed to loadcontainerModule A
andcontainerModule C
incontainerModule D
, I would have ambiguous bindings when I try to resolve my dependencies in incontainerModule D
because I would have loadedB
dependencies twice inA and C
.What would be a best practice for dealing with such a situation ? I believe it would be quite common in OO applications.
The text was updated successfully, but these errors were encountered: