Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var context = new Context();

            // use strategyA to do something
            context.SetStrategy(new StrategyA());
            context.DoSomethingWithStrategy();

            // use strategyB to do something;
            context.SetStrategy(new StrategyB());
            context.DoSomethingWithStrategy();
        }