Re:Java 24
by samus on Wednesday March 19, 2025 @06:36AM
(#43410239)
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.
[ Parent
| on HN ]
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.