开发者

Implementing a plugin interface

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜