0

For example, I have interface IRobot and I have an implementation RobotImpl. If I put annotation @Component on the interface will spring scan all it`s implementations? I think that annotation @Component is like saying "Hey Spring, create me an instance of this class and put it into your context so I could Autowire it later.", am I right?

cplusplus
  • 92
  • 8
  • 1
    Does this answer your question? [Where should @Service annotation be kept? Interface or Implementation?](https://stackoverflow.com/questions/16351780/where-should-service-annotation-be-kept-interface-or-implementation) – Vikas Jul 15 '20 at 14:42
  • I read it but I cannot completely understand. Does Spring create Beans for all implementations of the interface? – cplusplus Jul 17 '20 at 13:48

0 Answers0