Spring Context's "@Repository" vs. Spring Data's "Repository<T, ID>"
Spring Context provides an annotation org.springframework.stereotype.Repository .
From the Javadoc:
Quote:
[org.springframework.stereotype.Repository] indicates that an annotated class is a "Repository", originally defined by Domain-Driven Design (Evans, 2003) as "a mechanism for encapsulating storage, retrieval, and search behavior which emulates a collection of objects".
On the other hand, Spring Data provides an interface org.springframework.data.repository.Repository<T, ID extends Serializable> .
To me, both things seem to have the same intention. Are there best practices when to favor one over the other? Is it beneficial to add the @Repository annotation to a subtype of Repository<T, ID>?