Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Repository pattern interfaces #3495

Closed
fkromer opened this issue May 14, 2024 · 1 comment
Closed

Enhancement: Repository pattern interfaces #3495

fkromer opened this issue May 14, 2024 · 1 comment
Labels
Enhancement This is a new feature or request

Comments

@fkromer
Copy link

fkromer commented May 14, 2024

Summary

It's common practice to provide generic interfaces for implementing the repository pattern. It makes sense to provide several interfaces for specific types of application designs. CrudRepository is suitable for abstracting persistence of CRUD models. More generic repository interfaces are required for domain driven designs (DDD) involving aggregates, entities (value objects persisted as part of entities). Data abstraction objects (DAOs) can be seen as simple variants of a repository pattern or as an own pattern category (DAOs vs Repository).

Examples:

Basic Example

No response

Drawbacks and Impact

Impacts:

  • enables domain driven designs of different complexities

Unresolved questions

  • Should DAO patterns be considered separately from repository patterns?

Note

While we are open for sponsoring on GitHub Sponsors and
OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.

Check out all issues funded or available for funding on our Polar.sh dashboard

  • If you would like to see an issue prioritized, make a pledge towards it!
  • We receive the pledge once the issue is completed & verified
  • This, along with engagement in the community, helps us know which features are a priority to our users.
Fund with Polar
@fkromer fkromer added the Enhancement This is a new feature or request label May 14, 2024
@provinzkraut
Copy link
Member

This already exists :)

https://docs.litestar.dev/latest/usage/databases/sqlalchemy/models_and_repository

In fact, there's a whole repository dedicated to this (and more): https://github.com/litestar-org/advanced-alchemy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement This is a new feature or request
Projects
None yet
Development

No branches or pull requests

2 participants