DEV Community

Cover image for Answer: What's the difference between @Component, @Repository & @Service annotations in Spring?
Silvio Torre
Silvio Torre

Posted on

Answer: What's the difference between @Component, @Repository & @Service annotations in Spring?

From Spring Documentation:

The @Repository annotation is a marker for any class that fulfils the role or stereotype of a repository (also known as Data Access Object or DAO). Among the uses of this marker is the automatic translation of exceptions, as described in Exception Translation.

Spring provides…

Top comments (0)