Mid From PDF GoF Patterns Gang of Four Patterns

Adapter:?

  • The Adapter class implements the ITarget interface, and it wraps an

instance of the Adaptee class. It delegates calls from Request() to the

SpecificRequest() method of the Adaptee, making the two interfaces

compatible.

public class Adapter : ITarget

private readonly Adaptee _adaptee;

public Adapter(Adaptee adaptee) => _adaptee = adaptee;

public void Request() => _adaptee.SpecificRequest();

More from Design Patterns in C#

All questions for this course
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details