Proxy pattern کسی دوسری object کے لیے ایک placeholder یا surrogate فراہم کرتا ہے تاکہ اس تک رسائی کو کنٹرول کیا جا سکے۔ proxy کا real object کے جیسا interface ہوتا ہے لیکن یہ رویہ شامل کرتا ہے — جیسے lazy loading، access control، caching، یا logging — پھر اسے delegate کرنے سے پہلے۔
Proxy pattern کیا کرتا ہے
PROXY → an object that STANDS IN for another, controlling access to it:
→ same interface as the real object (clients use it transparently)
→ adds behavior BEFORE/AROUND delegating to the real object
→ controls WHEN and HOW the real object is accessed
→ "a stand-in that adds control/behavior"
