private static void Main() { var c = new Client(); c.Request(new Target()); c.Request(new Adapter()); }
static void Main(string[] args) { Client client = new Client(); client.Request(new Target()); client.Request(new Adapter()); Console.ReadKey(); }
private static void Main(string[] args) { // academic example var client = new Client(); client.Request(new Adapter(new Adaptee())); Console.WriteLine("\n"); // imaginary but more helpful example: // - imagine you have a driver who tries cross the desert, // - he drives a car // - but at some places it is impossible to drive a car // - so he should drive a camel var traveler = new Traveller(); traveler.Drive(new Car()); traveler.Drive(new TransportAdapter(new Camel())); }
static void Main() { var client = new Client(new Adapter()); client.Request(); }