What's a good way of adding a plugin interface 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.
What's a good way of adding a plugin interface 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: http://stackoverflow.com/questions/194698/how-to-load-a-jar-file-at-runtime.