Question: what is the difference between component and service in spring?
Answer: Difference between @Component, @Service, @Controller, and @Repository in Spring. ... @Component is a generic stereotype for any Spring-managed component or bean. @Repository is a stereotype for the persistence layer. @Service is a stereotype for the service layer.