Module 27 ยท Design Patterns (All 23 GoF) โ Lesson 6 of 23 ยท ~6 min
Adapter
Make a foreign interface fit the one you expect
Adapter wraps an object with an incompatible interface so it looks like the interface your code already uses. A third-party geocoder exposes lat_lng(address), but the rest of PawWalk calls geocoder.coordinates(address). Rather than rewrite every caller, you wrap the foreign object.
The adapter holds the foreign object and translates the call โ a thin layer of delegation.