摘要: package 抽象类_模板设计模式; public class Test { public static void main(String[] args) { Person p=new Person(); Robbt r=new Robbt(); Pig pig=new Pig(); p.command(Action.EAT);... 阅读全文
posted @ 2017-10-21 20:45 scwyfy 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 动态代理:(前提是要有接口) CGLIB实现的动态代理:不需要有接口 业务层的动态代理实例: package 动态代理设计模式; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; public class Servi... 阅读全文
posted @ 2017-10-21 20:41 scwyfy 阅读(179) 评论(0) 推荐(0) 编辑