Adapter pattern ایسی چیزوں کو ایک دوسرے کے ساتھ کام کرنے کی اجازت دیتا ہے جن کے interfaces مختلف ہوں — ایک کو دوسری کی توقع سے محفوظ کر کے۔ یہ دونوں interfaces کے درمیان ترجمان کا کردار ادا کرتا ہے، اور موجودہ کوڈ میں تبدیلی کیے بغیر انضمام کو ممکن بناتا ہے۔
Adapter pattern کیا کرتا ہے
ADAPTER → convert one interface into another that a client expects (a "translator"):
→ wrap an object whose interface is INCOMPATIBLE, exposing the interface the client needs
→ the adapter translates calls/data between the two interfaces
→ makes incompatible things work together WITHOUT changing either's code
