예제 #1
0
            public static void Run(string environment)
            {
                IocContainer.Setup(environment);

                var x = new ClientX();
                var y = new ClientY();

                x.MethodA();
                y.MethodB();
            }
예제 #2
0
            public static void Run(string environment)
            {
                ILoggable   log;
                ICalculator calculator;

                if (environment == "production")
                {
                    log        = new Logger();
                    calculator = new Calculator(log);
                }
                else
                {
                    log        = new AlternativeLogger();
                    calculator = new AlternativeCalculator(log);
                }

                var x = new ClientX(calculator);
                var y = new ClientY(calculator);

                x.MethodA();
                y.MethodB();
            }