Plugin Based Java Application Development

I am trying to create an application based on plugins, which means that in addition to the basic structure, other functions should be added using the plugin style.

The majar problem of such a system, I think, is how to load new plugins at runtime. I do not want to recompile the whole project when a new plugin is installed. Like Eclipse, after a new installation of the plugin, the user only needs to restart it. So my first idea about this is to use java reflection to load the class at runtime. there may be some plugin configuration files, the system reads them and loads the plugin classes with reflection. Perhaps I can use the spring structure, as its inverse of control just matches my query.

Another idea I'm learning is to use an ejb container. when the plugins are ejbs, I can just pack them in a jar and deploy them in an ejb container, then I can use jndi to access them. but it only works when the plugin is ejbs.

Anyway, I'm new to system design. therefore I am writing this topic and want to hear your opinions. By the way. Is there a good book on system design that you want to recommend?

Thanks in advance!

+4
source share
2 answers

You can first look at OSGI and its implementation (Equinox for Eclipse and Apache Felix), but it would be easier if you would give us more information about what you are trying to do.

+1
source

Plug-in to solve which problem?

Framework designers usually have in-depth knowledge of domains that inform about their design choices. A framework arises after two or three attempts to solve a problem; earlier implementations give clues on how to abstract out what's important in the framework.

Eclipse solves the problem of extensible IDE (bad in my opinion). EJBs are transactional, distributed components that run in a container.

You did not indicate which problem you want to solve. As long as you do this, your ideas will not be very far.

+1
source

All Articles