예제 #1
0
        private static void TestProxy()
        {
            ISimpleService svc = TransparentProxy.Create(new ProxyService());

            svc.Execute();
            var rst = svc.GetResult();

            Console.WriteLine("执行结果为:" + rst);
        }
예제 #2
0
        private static void TestAopDecorator()
        {
            ISimpleService svc = Proxy.Of <OtherService, ISimpleService>(1);

            svc.Execute();
            var rst = svc.GetResult();

            Console.WriteLine("执行结果为:" + rst);
            Proxy.Save();
        }
예제 #3
0
        private static void TestAopWrapper()
        {
            ISimpleService svc = AOPFactory.CreateInstance <OtherService, ISimpleService>(1);

            svc.Execute();
            var rst = svc.GetResult();

            Console.WriteLine("执行结果为:" + rst);
            AOPFactory.Save();
        }
예제 #4
0
 public void Execute()
 {
     Logger.Info("开始执行方法:Execute");
     service.Execute();
     Logger.Info("执行方法完成:Execute");
 }