3 ms·
> In this case you want a ThreeProvider and you don't care at all how it is implemented or where the value comes from. But that's the thing. Look at the code i
by JustSomeNobody 8y ago
> In this case you want a ThreeProvider and you don't care at all how it is implemented or where the value comes from.
But that's the thing. Look at the code in the comment I replied to. It calculates 6. You would have to _read_ the code to know why. A DI framework would make this situation even worse.
- vbsteven 8y agoThis is a case where the specific implementation of the ThreeProvider interface/contract is wrong. It has nothing to do with DI and the calling code in the Sample class is correct. The unit tests for the specific implementation should catch this. You have to read the code anyway when you are debugging this issue. And by having the implementation behind and interface you can fix the bug once and be sure that it is fixed everywhere it is used.