Open
Description
The section Fine-tuning Repository Definition of our reference docs should be clarified on why one would rather design their application repositories starting with Repository
and not use a more advanced base repository. It makes sense to elaborate on the following concerns:
- Controlled method exposure – architects might want to avoid exposing methods like
findAll()
as they're potentially expensive operations on the underlying data store and should not be used unless really necessary (for example, in test cases). - Defining other return types for collection methods – the core repository base interfaces declared
Iterable
as return type for CRUD collection methods. In 3.0 we have introduced additional interfaces that re-declare those methods usingList
as return type, but crafting a custom repository base interface can achieve that as well.