Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Design a Plugin based java application

I'm trying to make a plugin-based application which means, besides the basic framework, other functionalities should be added with a plugin style.

The majar problem of such system, i think, is how to load new plugins at the runtime. I don't want to recomplie the whole project when a new plugin installed. Just like Eclipse, after new installation of plugin, the user only need to restart it. So my first idea about that is using java reflection to load the class at the runtime. there might be some plugin configuration files, the system reads them and load the plugin classes with reflection. Maybe i can use the spring framework as well, because its Inversion of Control is just match my request.

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

anyway, i'm a rookie in system design. so i post this topic and want to hear of your opinions. btw. is there any good book about system design you want to recommand?

thanks alot in advance!

like image 786
cn1h Avatar asked Oct 24 '22 03:10

cn1h


1 Answers

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

like image 69
Dimitri Avatar answered Oct 27 '22 11:10

Dimitri