What are the differences between @Component, @Service, and @Repository annotations in Spring? When should you use each one?
Anoniem
@Component: A generic stereotype for a Spring-managed bean. @Service: A specialization of @Component used for service layer logic. @Repository: A specialization of @Component used for DAO (Data Access Object) classes, providing exception translation.