Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用JAVA的SPI规范来支持插件 #17

Open
jcai opened this issue Jun 15, 2020 · 1 comment
Open

使用JAVA的SPI规范来支持插件 #17

jcai opened this issue Jun 15, 2020 · 1 comment

Comments

@jcai
Copy link
Collaborator

jcai commented Jun 15, 2020

可以使用java的spi规范来实现插件系统,这样谁做的插件打包成jar,直接放入lib里面就可以自动加载了,不用显示的调用use之类的。

https://docs.oracle.com/javase/tutorial/sound/SPI-intro.html
https://docs.oracle.com/javase/7/docs/api/java/util/ServiceLoader.html

@diaozxin007 @redmaple1

@diaozxin007
Copy link

考虑过使用 spi 的实现方式,但是可能插件的代码量比较少,会有插件包的概念。很可能一个 jar 里面有好几个插件。感觉还是需要按需 use。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants