Proxy pattern किसी दूसरे object के लिए एक placeholder या surrogate प्रदान करता है ताकि उस तक पहुँच को नियंत्रित किया जा सके। Proxy का real object जैसा ही interface होता है लेकिन यह उसे delegate करने से पहले behavior जोड़ता है — जैसे lazy loading, access control, caching, या logging।
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"
