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!

有帮助吗?

解决方案

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.

其他提示

Plug-in to solve what problem?

Designers of frameworks usually have deep domain knowledge that informs their design choices. Frameworks come about after two or three attempts to solve some problem; the earlier implementations give clues about how to abstract what's important into a framework.

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

You've given no indication of what kind of problem you want to solve. Until you do, your ideas won't get very far.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top