|
|
|
|
|
by TheAceOfHearts
3821 days ago
|
|
This is sorta tangentially related... I used to think DI was a good idea, but as I've gotten more experience... I'm no longer convinced using a DI framework nets you huge wins relative to the added complexity. My hypothesis is that good design can remove the need for a DI framework in many cases, or at least that's been my experience so far. Maybe I just haven't worked in an application that's big and complicated enough to justify a DI framework. Don't get me wrong, there's usually going to a few moving parts you'll wanna inject, in order to make testing easier. But you can just... do it manually. Perhaps I'm wrong about this, but I get the impression DI tends to encourage people to obsess over unit testing and abuse mocks. While I certainly believe that unit tests add a lot of value, there's definitely a point where they start to add little to no value. Anyway, with that being said... The framework looks very interesting. I love looking through frameworks like these and seeing how people decide to tackle certain problems. Thank you for sharing! |
|
For the actual production use that a DI framework gives you, you can do similar, or manually set things up, or create a layer of indirection yourself, that only applies where you need it (say an IIFE that has the logic to determine which implementation to pull in, and return that function/module as appropriate).
But this is, as you say, largely tangential.