Spring has 4 Stereotype Annotation
@Component: Parent of all the Stereotype annotations, all stereotype annotations are internally annotated with @Component
@Controller: In MVC controller means which controls and rout the requests.
@Service: All Business logic holding classes should be annotated with @Service.
@Repository: All persistence layer interaction logic are written in DAO classes and all DAO classes should be annotated with @Repository. It also ensure all unchecked exception mapped to Spring DataAccessException.
@Component: Parent of all the Stereotype annotations, all stereotype annotations are internally annotated with @Component
@Controller: In MVC controller means which controls and rout the requests.
@Service: All Business logic holding classes should be annotated with @Service.
@Repository: All persistence layer interaction logic are written in DAO classes and all DAO classes should be annotated with @Repository. It also ensure all unchecked exception mapped to Spring DataAccessException.
No comments:
Post a Comment