[Best practice] Use Constructor-Based Dependency Injection with Spring
If you’ve been using Spring for a while, or copy-pasting some web tutorials or examples, you’ve probably put some @Autowired
annotations on private fields.
This does work, but it’s not the best way to do it.