コード例 #1
0
        static void Main(string[] args)
        {
            Ifactory  operFactory = new AddFactory();
            Operation oper        = operFactory.CreateOperation();

            oper.NumberA = 1;
            oper.NumberB = 2;
            double result = oper.GetResult();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            IFactory  factory = new AddFactory();
            Operation oper    = factory.CreateOperation();

            oper.NumberA = 1;
            oper.NumberB = 2;
            double result = oper.GetResult();

            Console.WriteLine(result);
            Console.ReadKey();
        }