static void Main() { var client = new Client {Strategy = new ConcreteStrategyA()}; client.CallAlgorithm(); client.Strategy = new ConcreteStrategyB(); client.CallAlgorithm(); }
private static void Main(string[] args) { Client client = new Client { Logger = new ConsoleLogger()}; client.DoSomeStuff("need more work!"); client.Logger = new DbLogger(); client.DoSomeStuff("work hard"); Console.ReadLine(); }
public static void Main(string[] args) { // create some names, as if by input or from some database: var names = new List<string> { "David", "Leonard", "Laura", "Linda", "Stephen", "Jean" }; // TODO: refactor the client and algorithms so that uncommenting the folling line works: var someClient = new Client(new Algorithms.Cool()); var results = someClient.ProcessNames(names); foreach(var result in results) { Console.WriteLine (result); }; }