Repository-kuvio abstrahoi tietojen käsittelyä kokoelmaa muistuttavan rajapinnan takaa — erottaen liiketoimintalogiikan siitä, miten tiedot tallennetaan ja haetaan. Se irrottaa sovelluksen tietolähteistä (tietokannat, API:t), parantaen testattavuutta ja ylläpidettävyyttä.
Repository-kuvion toiminnallisuus
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
