The above annotations are closely related, so my questions are as follows:
1- Can @Component,
@Repository
and annotations @Service
be used interchangeably in Spring or do they provide any particular functionality besides acting as an annotation?
In other words, if I have a service class and I change the annotation from @Service
to @Component
:
2- Will it continue to behave in the same way? or does the annotation also influence the behavior and functionality of the class?
3-Could I exchange them and, for example, use @Service
when conceptually I should have @Repository
?