- @Component – generic and can be used across application.
- @Service – annotate classes at service layer level.
- @Controller – annotate classes at presentation layers level, mainly used in Spring MVC.
- @Repository – annotate classes at persistence layer, which will act as database repository.
Read full article from Spring @Component, @Service, @Repository, @Controller Difference
No comments:
Post a Comment