2017年3月30日15:00:19 fq以后的以后 动态代理

  代理与继承,组合不同的是,继承是继承父类特性,组合是拼装组合类的特性,代理是使用代理类的指定方法并可以做自定义。

  静态类是应用单个类,当代理的类数量较多时可用动态代理,动态代理在概念上很好理解

http://bbs.csdn.net/topics/300084810
Proxy.newProxyInstance(ClassLoader loader, Class<?>[] interfaces, InvocationHandler h) 记得这是java写好的生成动态代理的方法至于连接的例子目前有些地方还是没看懂
 public Object invoke(Object proxy,Method method,Object[] arges)throws Throwable
        {
               Object result=null;
              Double firstPrice=(Double)arges[1];
              arges[1]=firstPrice+price;
              try
              {
                     result=method.invoke(ihouse,arges);
               }
               catch(Exception ex)
               {
                      ex.printStackTrace();
               }
               return result;
       }
这个方法被调用了么,method.invoke被调用了么,调用了什么方法。http://www.cnblogs.com/onlywujun/p/3519037.html 但是要先休息//TODO
原文地址:https://www.cnblogs.com/Luke-wang/p/6647040.html