spring-projects / spring-projects/spring-data-commons

Refine section on fine-tuning repository interfaces in the reference documentation

Open
#2,757 0 comments 0 reactions 1 assignee View on GitHub

@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 Iterable as return type for CRUD collection methods. In 3.0 we have introduced additional interfaces that re-declare those methods using List as return type, but crafting a custom repository base interface can achieve that as well.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.