Repository pattern data access को एक collection जैसे interface के पीछे abstract करता है — business logic को इस बात से अलग करता है कि data कैसे store और retrieve किया जाता है। यह application को data sources (databases, APIs) से decouple करता है, जिससे testability और maintainability बेहतर होती है।
Repository pattern क्या करता है
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
