Skip to content

Commit 4ee9218

Browse files
committed
Update Java SPI机制详解.md
1 parent 2f3e21e commit 4ee9218

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

database/note/Java SPI机制详解.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
SPI 全称为 (Service Provider Interface) ,是JDK内置的一种服务提供发现机制。SPI是一种动态替换发现的机制, 比如有个接口,想运行时动态的给它添加实现,你只需要添加一个实现。我们经常遇到的就是java.sql.Driver接口,其他不同厂商可以针对同一接口做出不同的实现,mysql和postgresql都有不同的实现提供给用户,而Java的SPI机制可以为某个接口寻找服务实现。
77
```
88

9-
![](..\\image\\spi.jpg)
9+
![](../image/spi.jpg)
1010

1111
​ 如上图所示,接口对应的抽象SPI接口;实现方实现SPI接口;调用方依赖SPI接口。
1212

0 commit comments

Comments
 (0)