spring-projects / spring-projects/spring-data-commons
Refine section on fine-tuning repository interfaces in the reference documentation
Open
@odrotbohm is already working on this.
Since Jan 3, 2023.
in: documentation
- Dominant language
- Java
- Stars
- 838
- Forks
- 730
- PR merge metrics
- No merged PRs in 30d
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
Iterableas return type for CRUD collection methods. In 3.0 we have introduced additional interfaces that re-declare those methods usingListas return type, but crafting a custom repository base interface can achieve that as well.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.