|
|
|
|
|
by mrkeen
1197 days ago
|
|
I feel exactly the same way about DI. Structuring code so that abstractions don't depend upon implementation details is in my top 3 principles of all time (along with pure functions and good typing). DI frameworks a la Spring and Guice just annoy me. |
|
So you refactor everything, factor out the constructor, and then it passes but now you need to add a new dependency so you're right back to the same nonsense. And/or you have tons of classes getting dependencies they don't even need, because some do so the parent has to have them all.
Traits can help some.
But the abstractions and DI that were supposed to make things easier still often make things more complicated.