Question

I'm building an application, and I'm thinking long-term I would like to be able to allow plugin support. The application I'm creating is a Java based application. How could I allow plugins using a scripting language, or is it better to require plugins to use Java?

Would I need to create some sort of plugin interface to allow the use of plugins?

Any ideas of references of where to start?

Was it helpful?

Solution

If you ask me, plugins using Java is better as it is relatively easier than scripting languages. You have to provide some sort of interface to the plugins. After you successfully implemented the plugin architecture, it is also useful for yourself to implement extra-functionality to your application, without breaking the existing code. See how NetBeans or Eclipse works. Those softwares load a number of files in the name of "packages" during start-up. Those packages are actually a kind of plugins. Alternatively, implementing a successful plugin architecture require quite some effort and costs performance (see the load times of Eclipse).

https://stackoverflow.com/questions/465099/best-way-to-build-a-plugin-system-with-java http://www.javaranch.com/journal/200607/Plugins.html

OTHER TIPS

If you, or others with similar skills will be writing the plugins, then why not stay with the host language? If your application addresses a particular (non-software) area of expertise, and you want to give end-users the ability to write their own plugins, then a custom scripting language, well suited to expressing solutions in the end-users' domain of expertise, could make the plugin interface more accessible to them.

In your design you'll need to consider what parts of your application you want to expose to the plugin interface, and how to limit the potential damage from a badly written plugin. Those answers will guide you to the design of the interface.

Licensed under: CC-BY-SA with attribution
scroll top