Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 13
    Can you tell what are the differences between annotating interfaces and annotating implementations? Commented May 4, 2013 at 2:54
  • 42
    From the Spring docs, "This annotation serves as a specialization of @Component, allowing for implementation classes to be autodetected through classpath scanning," suggesting that it's intended to be used on the implementation class. Commented Jul 2, 2015 at 13:24
  • 1
    @TheKojuEffect, This post explains in details difference between annotating interfaces vs implementations - stackoverflow.com/questions/3120143/… Commented Feb 1, 2017 at 6:56
  • 1
    @user3257644 Just note that the suggestions given by the answers in that post are in regards to the '@Transactional' annotation specifically, not all annotations in general. Commented Feb 6, 2017 at 6:29
  • 3
    The @service annotation on interfaces has no effect, just as the other stereotype annotations. All stereotype annotation should be put on either abstract or concrete classes. Commented Mar 26, 2017 at 2:27