Spring - Difference between @Component, @Service, @Controller, and @Repository Annotations

50 Views
Published
In this video tutorial, we will discuss the difference between @Component, @Service, @Controller, and @Repository Annotations with examples.

Here is a summary of what does @Component, @Service, @Controller, and @Repository annotation do in Spring Framework:
- @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.
- @Controller is a stereotype for the presentation layer (spring-MVC).

#spring #javaguides #springframework
Be the first to comment