Het Repository patroon abstraheert data access achter een collectie-achtige interface — het scheidt business logic van hoe data wordt opgeslagen en opgehaald. Het ontkoppelt de applicatie van gegevensbronnen (databases, API's), wat testbaarheid en onderhoudbaarheid verbetert.
Wat het Repository patroon doet
REPOSITORY → an abstraction layer between business logic and DATA ACCESS:
→ provides a clean interface (like a collection: findById, save, delete, findAll)
→ HIDES how/where data is actually stored (database, API, cache, files)
→ business logic uses the repository, NOT the database directly
→ separate WHAT data operations from HOW they're implemented
