I'm investigating JSPF as a potential plugin framework for use in
OpenRocket, a model rocket simulator. My goal is that developers
would be able to create plugins as jar files, which users could just
drop into a plugin directory, and the software would load the plugins
from the dir.
After reading the docs, I still have some questions:
1. The obvious one: Are plugins singletons? That is, will the
PluginManager always return the same instance, or will it always
create new instances of plugins? (I couldn't find this in the docs..)
2. Can plugins depend on classes that are part of the base
application? The documentation states that the plugins should be
self-contained. However, the application contains quite complex data
structures which the plugins need to be able to manipulate, and
abstracting all of those behind interfaces is quite unpractical. So
can a plugin depend on application classes that are not included in
the jar?
3. Is there any kind of support for multiple plugins defined by a
single class? At some point I'd like to create the possibility of
writing plugins in scripting languages. My idea was that a JSPF
plugin would scan the script directory, and instantiate plugins for
each script it finds. Is this in any way possible directly with the
JSPF framework, or do I need to create a second plugin-framework API
on top of JSPF? (For example, if a plugin instance knows what
capabilities it was queried with, that could be used to select the
correct script.)
Thanks!
Cheers,
Sampo N.
1. The obvious one: Are plugins singletons? That is, will the
PluginManager always return the same instance, or will it always
create new instances of plugins? (I couldn't find this in the docs..)
2. Can plugins depend on classes that are part of the base
application? The documentation states that the plugins should be
self-contained. However, the application contains quite complex data
structures which the plugins need to be able to manipulate, and
abstracting all of those behind interfaces is quite unpractical. So
can a plugin depend on application classes that are not included in
the jar?
single class? At some point I'd like to create the possibility of
writing plugins in scripting languages. My idea was that a JSPF
plugin would scan the script directory, and instantiate plugins for
each script it finds. Is this in any way possible directly with the
JSPF framework, or do I need to create a second plugin-framework API
on top of JSPF? (For example, if a plugin instance knows what
capabilities it was queried with, that could be used to select the
correct script.)