Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In response to:

"DI, in the sense of separating the instantiation of long-lived service objects from the classes containing business logic that accesses those long-lived service objects, is a great thing for testability and maintainability."

You don't need a DI framework to do any of what you described. Also, I believe that what you are saying doesn't fundamentally describe DI, though it is related. In this post I go over what DI really means: https://sreque.blogspot.com/2019/09/dependency-injection-101...

I have never seen a case where using autowiring forms a legitimate tradeoff; it has always resulted in worse, harder-to-maintain code with little benefit in return.

I conflate Spring with Spring Boot because Spring Boot is built on Spring and most of my problems with Spring Boot apply equally to Spring.



Your blog post is, frankly, wrong. That's not what DI is usually used or understood to mean.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: