适配器模式 源码举例

This commit is contained in:
2018-10-14 15:58:37 +08:00
parent 5b6775bcaa
commit 75e8bd5f52
2 changed files with 13 additions and 2 deletions

10
pom.xml
View File

@@ -12,8 +12,8 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<org.springframework.version>5.1.0.RELEASE</org.springframework.version>
</properties>
@@ -81,6 +81,12 @@
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>2.0.10.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>

View File

@@ -3,6 +3,11 @@ package top.fjy8018.designpattern.pattern.structural.adapter.classadapter;
/**
* 适配器模式:将一个类的接口转换成客户希望的另一个接口。适配器模式让那些接口不兼容的类可以一起工作
*
* JDK源码{@link javax.xml.bind.annotation.adapters.XMLAdapter}
* spring源码{@link jdk.internal.org.objectweb.asm.commons.AdviceAdapter}
* {@link org.springframework.web.servlet.HandlerAdapter}
* JPA源码{@link org.springframework.orm.jpa.JpaVendorAdapter}
*
* @author F嘉阳
* @date 2018-10-09 16:07
*/