use @autowired in abstract base class
问题 As I know, field injection is not recommended. Should use constructor instead. What I'm trying to do here is using @Autowired in the constructor of the base class, and make it accessible for all the subclasses. In some subclasses, I also need some specific beans to be @Autowired from their constructors. Demo code is as following: Base class: public abstract class Base { protected final MyDemoService myDemoService; @Autowired public Base(MyDemoService myDemoService) { this.myDemoService =