What’s the difference between @component, @repository & @service annotations in spring?



What’s the difference between @component, @repository & @service annotations in spring?..

Answer / Manish

@Component scans and instantiates any Spring-managed beans. @Repository is used for data access layer components (such as daos). @Service is a more generic alternative to both @Component and @Repository, and is typically used for business logic layers.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Spring Framework Interview Questions

What is difference between model and modelmap?

1 Answers  


What are important spring projects?

1 Answers  


What is difference between @controller and @restcontroller?

1 Answers  


Is spring boot a microservice framework? : Spring Boot

1 Answers  


What is the difference between autowiring and dependency injection?

1 Answers  


What is spring ioc container?

1 Answers  


What is @pathparam?

1 Answers  


What is @controller annotation in spring?

1 Answers  


Is spring an open source?

1 Answers  


What is the use of dispatcher servlet?

1 Answers  


Why do we need view resolver in spring mvc and what is an internal view resolver in spring?

1 Answers  


Why dependency injection is required?

1 Answers  


Categories