Java设计模式——适配器模式

JAVA 设计模式 适配器模式

用途


适配器模式 (Adapter)
将一个类的接口转换成客户希望的另外一个接口。
Adapter模式使得原本由于接口不兼容而不能一起工作的那些类可以一起工作。
适配器模式是一种结构型模式

结构


aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAkgAAADzCAIAAADy7n5nAAAgAElEQVR4nO3dd0ATd//A8QCihQraPtZRxbr3bF3Vtv4cVVSsQu2j0goocTxVFFDACggKMkTqrFYFVEAQK6iIguKWUUFREEW2TBFkhJF99/398YXzCCRCEggkn9df7YfL5Ugi7+RyuTAQAAAAoEQYit4AAAAAQJ4gbAAAAJQKhA0AAIBSgbABAABQKhA2AAAASgXCBgAAQKlA2AAAACgVCBsAAAClAmEDAACgVCBsAAAAlAqEDQAAgFKBsAEAAFAqEDYAAABKBcIGAABAqUDYAAAAKBUIGwAAAKUCYQMAAKBUIGwAAACUCoQNANDGSAEihYreCKBCIGwAgBYjCYSIVl+K4CKChxAJeQPtA8IGAGgxgo0IrpSXJQVIWCPXrQGgeRA2AEDLkQiRsl0cgDYHYQMAtFj9TkUAOjQIGwAqx8PD4+nTp9JcEg4DAZ2B9GHjcDj+/v4nQXMuX74sxzupgxMKhcHBwYq+yTuoixcvKvr+acaECROCgoJavnxVVdXp06ffv38v4/WyWKzTp08r+j5RFSUlJTLeX52X9GErKyvr06fPuHHjZoHGhg0bNn36dDneSR0cl8sdNmzY6NGjFX3DdzgjR44cO3Zsm974SUlJZWVlrb1Ua8OWnp6uqan5/PlzMT8nENmiQyUzMzO7du06adIkRd8zSm7q1KkaGhqxsbEtv4uVjKxhu3Pnjhy3BiGkBG8v+/r6qmDYrl69qugN6XBCQkLaOmzjx4+/cOGCyLC2traysrKysrK6upoacjicygZjx47FYePz+dSQx+OJTCorKzkcDmoI26NHj6gJQRAflqmrQsI6fC3V1dV4WFtb23RrcdiSkpLa5sYA9QoKCnr06AFhk0abhI3kU/9COi8IG8AUFbbff/+9f//+/fv3nz17tlBY/5bYw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YQMAAKBUIGwAAACUCoQNAACAUoGwAQAAUCoQNgAAAEoFwgYAAECpQNgAAAAoFQgbAAAApQJhAwAAoFQgbAAAAJQKhA0AAIBSgbABAABQKhA2AAAASuX/AdchJ/V3Nw0KAAAAAElFTkSuQmCC" alt="" data-bd-imgshare-binded="1" />
图-适配器模式结构图

Target : 定义用户实际需要的接口

abstract class Target {

    public abstract void Request();

}

Adaptee : 定义一个需要适配的接口

class Adaptee {

    public void SpecificRequest() {

        System.out.println("特殊请求");

    }

}

Adapter : 通过在内部包装一个 Adaptee 对象,把源接口转换成目标接口。


class Adapter extends Target {

    private Adaptee adaptee = new Adaptee();

    @Override

    public void Request() {

        adaptee.SpecificRequest();

    }

}

测试代码

public class AdapterPattern {

    public static void main(String[] args) {

        Target target = new Adapter();

        target.Request();

    }

}

运行结果

特殊请求

应用场景


想要使用一个已经存在的类,但如果它的方法不满足需求时;

两个类的职责相同或相似,但是具有不同的接口时要使用它;

应该在双方都不太容易修改的时候再使用适配器模式适配,而不是一有不同时就使用它。

转自:http://www.cnblogs.com/jingmoxukong/p/4224192.html

上一篇:JAVA 设计模式 适配器模式


下一篇:pycharm 格式化代码