3 ms·
Spring Boot DI seems like a crutch for bad design decisions. You make these things called Beans and make them globally accessible from anywhere in your applicat
by yellow_lead 5y ago
Spring Boot DI seems like a crutch for bad design decisions. You make these things called Beans and make them globally accessible from anywhere in your application. I won't lie that Spring Boot for backend APIs is really convenient though, after 6 months or so of figuring out how all the magic works.
- bberrry 5y agoTaking a dependency as part of composition is quite different from being "globally accessible" in my opinion.
- ohgodplsno 5y ago>Constructors seems like a crutch for bad design decisions. You make these things called functions and make them globally accessible from anywhere in your application I know allocating memory is haram for some, but DI is basically just moving constructor calls up one level
- StevePerkins 5y agoShow me a complaint about "dependency injection" as a concept, and I'll show you someone who does little or no unit testing. The only real ways to do it are dependency-injecting mocks, or else maybe a Python-style "patch" approach where you're literally overwriting portions of the code under test at runtime. I've seen the latter kinda-sorta work in Python shops, but the former is far more sane.