适配器模式
摘要:
package structual.Adapter.one;/** * 适配器模式, * 把一个类的接口换成客户端期待的接口形式,使原本因为接口不匹配不能工作的两个类能够在一起工作 * @author zhangchy * *//** * 类适配器模式 * * 与Adeptee是继承关系 * 可以置换Adaptee的方法方便,能够重写和覆盖 */class Adeptee{ public void methord1(){ System.out.println("this is methord1"); }}interface Itarget{ public void meth 阅读全文
posted @ 2012-03-20 17:55 康安V 阅读(162) 评论(0) 推荐(0)