Repository pattern ڈیٹا رسائی کو ایک collection-like interface کے پیچھے abstracts کرتا ہے — business logic کو الگ کرتا ہے کہ ڈیٹا کیسے محفوظ اور حاصل کیا جاتا ہے۔ یہ application کو ڈیٹا sources (databases, APIs) سے الگ کرتا ہے، 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
