Structural patterns
Adapter
Wraps an incompatible interface so it matches what the client expects, without touching existing code.
Article
Adapter – how to get along with code that speaks another language
Adapter translates the interface of a foreign class into the interface your code expects. An example of integrating a third-party geocoding SDK in C#, TypeScript, Java, Go and Python.
Related articles
- Facade – one simple entry point to a complex subsystem
Facade exposes one convenient operation that coordinates many subsystem classes behind the scenes. An example of course enrollment with payment, access and a welcome email in C#, TypeScript, Java,…
- Bridge – two axes of change without a class explosion
Bridge separates the abstraction (what we do) from the implementation (how we do it), so both hierarchies can evolve independently. An example of notifications and delivery channels in C#,…
- Proxy – a stand-in that controls access to the real object
Proxy has the same interface as the real object and stands in front of it, deciding when – and whether – to pass a call on. An invoice archive example with access control and a lazy connection in…
Challenges
Around the topic
- Proxy vs Adapter vs Facade Pattern | Code Walks 012 video · youtube · Christopher Okhravi
- Adapter Pattern – Design Patterns (ep 8) video · youtube · Christopher Okhravi
- Adapter article · web · Refactoring.Guru
- Anti-Corruption Layer Pattern article · web · Microsoft Azure Architecture Center
- Design Patterns: Elements of Reusable Object-Oriented Software book · openlibrary · Erich Gamma, John Vlissides, Richard Helm, Ralph Johnson
- Adapter / Adapter article · web · Refactoring.Guru
- Design Patterns Part 4 – Adapter, Facade, and Memento podcast · apple-podcasts · Coding Blocks
- Facade vs Proxy vs Adapter Design Patterns article · devto · Mohamed Mayallo