Path: csiph.com!aioe.org!.POSTED!not-for-mail From: Qu0ll Newsgroups: comp.lang.java.programmer Subject: Re: plugin architecture Date: Thu, 21 Jul 2016 05:10:39 +1000 Organization: Aioe.org NNTP Server Lines: 50 Message-ID: References: NNTP-Posting-Host: YQRXa3Jyda5ulJ59FdP57g.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.java.programmer:35016 On 20/07/2016 16:29, Philipp Kraus wrote: > Hello, > > I'm searching for an indea for a plugin architecture. > I have found PF4J, OOGI and JPF. > > At the moment I would like to use PF4J, but I'm at the moment on the conceptiual phase, so > I don't finished my complete requirements. But at the moment I'm thinking about the plugin structure, > so I think my plugins implements an equal interface. Finally a Jar should contains the plugin. > At the moment I have got a question: Is it a good idea, that one Jar file store multiple plugins or is > it better that one plugin is represent by one Jar file. > > I create a complexe software, so in some cases a multi-plugin approach could be nice, because I can build > "plugin packages". On the other hand, the software architecture can be more cleaner, if I don't allowd multi-plugins. > > Another question is because I'm using Google Guava and there exists a reflection API, so I can iterate over all >classes within a package. IMHO I can use this reflection to load my plugin. Is this a good choice? > A plugin cannot be changed in my case during runtime, so the plugin will put to the classpath / classloader and than > I can iterate overall classes within the plugin package and check if a class implements the plugin interface. > On this I can instantiate the plugin. > With this structure I can build the multi-plugin approach. > > Hope for some comments to get a better idea for my architecture Hi Phil, I realise it may not be exactly what you are after, but have you checked-out Java 9 and the Jigsaw module system? You will eventually have to make your software Java 9 & Jigsaw compatible anyway so maybe it could be a good place to start. Early releases of Java 9 with Jigsaw have been available for some time. Also, I am not even sure that JARs are really the way Java is heading (especially with Jigsaw). Just some things to consider... -- And loving it, -Qu0ll (Rare, not extinct) _________________________________________________ Qu0llSixFour@gmail.com [Replace the "SixFour" with numbers to email me]