All are stereotypes for component scanning; the main difference is intent. `@Service` marks business logic, `@Repository` marks persistence and can translate persistence exceptions, and `@Component` is generic.
All three annotations are meta-annotated with `@Component`, so they are discovered by component scanning and registered as beans. The difference is mostly **semantic** (communicating intent), but `@Repository` also enables a practical feature: **persistence exception translation** into Spring’s `DataAccessException` hierarchy.
@Repository
class UserDao {
// JPA/JDBC calls
}
@Service
class UserService {
private final UserDao dao;
UserService(UserDao dao) { this.dao = dao; }
}