Re:Java 24
by fiddlerwoaroof on Tuesday March 18, 2025 @11:31PM
(#43408047)
> This seems awfully close to "avoid Spring" to me, heh.
Exactly :)
Spring is perfectly usable without `@Autowired`, at least outside of test classes. SonarQube has a rule that helps avoiding it. Just use constructor injection instead.
Re:Java 24
by fiddlerwoaroof on Wednesday March 19, 2025 @09:12PM
(#43418994)
Any form of dependency injection by classpath scanning is an antifeature
Classpath scanning is completely optional.
Constructor injection is still autowiring. Spring used to demand that you annotate constructor arguments with @Autowired but that changed some time ago.
This seems awfully close to "avoid Spring" to me, heh.
Though, I've grown rather fond of Spring Boot over time, but I've gathered that's not exactly the popular consensus.