Adapter pattern ले असंगत इन्टरफेसहरू भएका वस्तुहरूलाई एकै अर्कोसँग काम गर्न दिमछ। यो एकलाई अर्कोले अपेक्षा गरेको इन्टरफेसले लपेट गरेर एकै अर्कोको बीचमा अनुवादक को रूपमा काम गर्छ, जसले मौजुदा कोड परिवर्तन नगरीकन एकीकरण सक्षम गर्छ।
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
