Advertisement

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

Spring - Difference between @Component, @Service, @Controller, and @Repository Annotations 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

Annotations

Post a Comment

0 Comments