Repository પેટર્ન ડેટા એક્સેસ ને સંગ્રહ જેવા ઇન્ટરફેસ પાછળ અમૂર્ત કરે છે — બિઝનેસ લોજિક્સને ડેટા કેવી રીતે સંગ્રહ અને મેળવવામાં આવે છે તેનાથી અલગ કરે છે. તે એપ્લિકેશનને ડેટા સ્ત્રોતો (ડેટાબેસ, API)માંથી અલગ કરે છે, પરીક્ષણક્ષમતા અને જાણીતાપણા માં સુધાર કરે છે।
Repository પેટર્ન શું કરે છે
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
