Autowiring Spring beans in a super class extended by many subclasses-Collection of common programming errors
As always, it depends. If all your beans are singleton scoped it shouldn’t be much of a problem, this is the “official party line”.
If your beans are request scoped (like for instance a controller class), you may have a much bigger problem than you’re aware of. Maybe some of those dependencies are also not singletons ? You can easily have 500 beans being constructed for every instantiation of a request scoped controller class, since you’re building dependencies and their dependencies and so on.
Now since bean instantiation is slow as the glaciers in spring, you do have a problem. The official party line of the spring framework seems to be to ignore this problem, as I am sure @Bozho will vehemently defend in the comments of this response. All this is obviously because the “web scopes” were retro-mounted over the existing design in spring 2.0, and due to the huge amount of supported use-cases, this was done totally on the premises of the existing implementation.
The solution is, of course, to normalize your wired in dependencies; don’t put them all in the base class. If you’re lazy you can wire in an ApplicationContext and use explicit calls to getBean for each service when it’s needed. This is, of course, totally contrary to any design guidelines for spring.