4 ms·
It's funny how times have changed. Spring used to be that (micro)framework that prevented your code to depend on anything framework related. And here we are now
by coutego 4y ago
It's funny how times have changed. Spring used to be that (micro)framework that prevented your code to depend on anything framework related. And here we are now...
I have been avoiding inheritance like the plague since at least 15 years ago and enjoying the pleasure of working with Spring for the same amount of time, approximately. But nowadays looking at what people do with Spring makes me extremely sad. Every time I find people "injecting" things by using annotations I can just think "WFT? Haven't we learnt /anything/?"
- mrkeen 4y agoNo, nothing's changed. Spring still infects your whole codebase. Just look at the imports, or try to run your code via a different framework if you think I'm exaggerating. Its proponents still make the same claims about it protecting you from coupling, not causing it.
- coutego 4y agoSpring does not need to infect your codebase. You can use the container without importing anything from Spring in other than one class (the one bootstrapping the system). If you want to use Spring classes in the implementation of your clases then yes, you will need to import them. But this is no different than any other library. If you just use XML configuration files (or use @Configuration) you don't (shouldn't) use @Inject, @Autowire and all other abominations. Or at least you didn't need, last time I checked a couple years ago. All your code is clear, free of any Spring code (unless you use some of the libraries) and fully reusable, testable, etc. Why everyone moved to annotations for "dependency injection" (that crap is NOT DI!!!!!), not only in Java, but Python, Typescript, etc. I just can't understand. It can't only be the convenience of doing so by saving some keystrokes, but I just can't get it. We solved the modularity beautifully with Spring (and other DI engines) and then we proceed to throw away the solution and recreate the problem again? Get off my lawn...