Proxy pattern จัดให้มี ตัวแทนหรือตัวยืน (surrogate) สำหรับออบเจ็กต์อีกตัวเพื่อควบคุมการเข้าถึงมัน proxy มี interface เดียวกับออบเจ็กต์จริงแต่เพิ่มพฤติกรรม เช่น lazy loading, การควบคุมการเข้าถึง, 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"
