摘要: 使用场景: 接口转换一、对象适配器(优先选用)优选的原因:多用聚合,少用继承原始接口类:public class Adaptee { public void standardRequest(){ System.out.println("这是原始标准接口!"); }}目标接口:public interface Target { public void newRequest(); }适配器类://聚合的方式,适配器类中“原始接口对象”作为其成员对象public class Adapter implements Target ... 阅读全文
posted @ 2011-12-20 01:28 edisonfeng 阅读(579) 评论(0) 推荐(0) 编辑