For example, I have 1000+ services, and each of them implements some interface AwesomeInterface
.
My plan is to autowire the collection of such services into MainService's constructor so that I can use them afterward:
public MainService(@Autowired List<AwesomeInterface> services){
this.services = services;
}
The question is: can I autowire so many services technically? I mean, is it enough memory, etc? I do not want to create all of them to test my theory :)
P.S. I believe that it may be not the best thing to autowire such a big amount of bins, however, I am still curious :)
I use SpringBoot, Java11