开发者

Implementing a plugin interface

开发者 https://www.devze.com 2022-12-30 05:06 出处:网络
What\'s a good way of adding a plugin interfac开发者_如何学运维e such that it\'s possible to have optional components?

What's a good way of adding a plugin interfac开发者_如何学运维e such that it's possible to have optional components?

I'm aware of the Class.forName() approach (used with JDBC for example) but there is also this approach to dynamic class loading.


You may have a look at this: http://jpf.sourceforge.net/.

A good approach would be to load jar files in a specified directory at runtime and look if they contain plugin classes. Have a look at this: How to load a jar file at runtime.

0

精彩评论

暂无评论...
验证码 换一张
取 消