Difference between @Service and @Component in Spring
Spring 2.5 has introduced 3 stereotype annotations: @Component, @Service and @Controller.
The most widely used are @Component and @Service and let us find what is the difference between them.
They both belong to package org.springframework.stereotype
When annotating your class with @Component you mark it as a regular java component class When annotating with @Service you mark it as a “special” type of component for special purpose like transaction or associating with aspects.
So you may ask that a class marked as @Component cannot participate in Transaction ?
Nope that is not true. I have not tried it but will test and post the results here.
Usage : When creating a class like action class to be used in web layer or mail utility , mark them as @Component and when creating service class annotate them as @Service
In future releases there are additional functionality to be added on @Service and @Repository