Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

creating a system that can work with plug ins

 
Georgios Chatziefstratiou
Ranch Hand
Posts: 106
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there

I want to implement a Java application with plug in function

Does any one know where to start.I don’t even know how to do it.

I have good knowledge of Java but never came on something like that any ides help tips where to start or how to implement it .

in some words how this will work is that It will be an application that run on web or not and some one can add plug ins with functionality s (new tools new functions new styles) if not maybe then it can be implement on a desktop application and how ?

how should i start?
After a lot of research i cannot find something to start any ideas where to?
How to create something that accepts plug ins to work.All the help is most welcome


thanks in advance
 
Winston Gutkowski
Bartender
Pie
Posts: 10417
63
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Horche Gratsias wrote:I want to implement a Java application with plug in function
...
I have good knowledge of Java but never came on something like that any ides help tips where to start or how to implement it .

Interesting question.

I've never tried it - at least not in the way that I think you mean, but my first thoughts on the subject seem to be borne out by this page.

First: you have to come up with a protocol - by which I mean a set of methods or interfaces that ALL plugins have to adhere to.

Second: You'll need to design your project around interfaces rather than classes.

Third: You'll probably need some form of "registration" mechanism, so that existing code understands which plugins it actually has to work with.

As for the mechanics: Dunno; never tried it. But I suspect that you'll be spending a lot of time in the "abstract".

Winston
 
Jayesh A Lalwani
Rancher
Posts: 2756
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well the whole have Java servlets API is built around this very idea. It allows you to develop some piece of code that can service HTTP requests and plugin to the web container. You might want to study web containers more and borrow some ideas.


 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I may strut my own stuff, start here: http://www.javaranch.com/journal/200607/Journal200607.jsp#a1

That's a lightweight approach, though. For heavy-duty stuff you'd use OSGi these days.
 
Rob Spoor
Sheriff
Pie
Posts: 20527
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ServiceLoader is another useful tool that can be used these days to discover the plugin implementation classes, combined with a class loader to load the classes.
 
Winston Gutkowski
Bartender
Pie
Posts: 10417
63
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:If I may strut my own stuff, start here: http://www.javaranch.com/journal/200607/Journal200607.jsp#a1

Wow. Some page; and right on point. My kudos.

Winston
 
Georgios Chatziefstratiou
Ranch Hand
Posts: 106
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys thanks for your help and suggestions.

I will look all your link sites and give you feedback.
 
J. Kevin Robbins
Bartender
Posts: 1759
19
Chrome Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:If I may strut my own stuff, start here: http://www.javaranch.com/journal/200607/Journal200607.jsp#a1

That's a lightweight approach, though. For heavy-duty stuff you'd use OSGi these days.


That was fascinating. Thanks for that article.

 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15272
37
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are complete frameworks such as OSGi and the Netbeans module framework which help you to create applications that can have plugins, complete with auto-update mechanisms etc. You might want to look into those, although they're both not frameworks that are really easy to understand.
 
J. Kevin Robbins
Bartender
Posts: 1759
19
Chrome Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been struggling to create a NetBeans plugin, but the learning trail at netbeans.org doesn't work with 7.2. There is a bug in 7.2 that prevents junit from installing and the GoogleToolbar tutorial example depends on it. I've spent the last 3 days looking for a solution to the junit problem and it appears that I'll have to wait for 7.3.

If you know of any articles/sites/books about netbeans plugin development, please point me in the right direction.

 
Georgios Chatziefstratiou
Ranch Hand
Posts: 106
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jk Robbins wrote:I've been struggling to create a NetBeans plugin, but the learning trail at netbeans.org doesn't work with 7.2. There is a bug in 7.2 that prevents junit from installing and the GoogleToolbar tutorial example depends on it. I've spent the last 3 days looking for a solution to the junit problem and it appears that I'll have to wait for 7.3.

If you know of any articles/sites/books about netbeans plugin development, please point me in the right direction.


yes i have notice that many code samples from netbeans.org don't work I really don't understand why ?
I still have to read all the material people said me here in forum when i am at the end i will give the feedback for all of them.
 
Georgios Chatziefstratiou
Ranch Hand
Posts: 106
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi people .
thanks a lot for your help .
After Reading a lot the only think i can say is that the simplest way to do an application is by using the Netbeans pltaform or Eclipse platform.

I have read all the tutorials you give me and it's very hard to design it . The best way to do it is by using one of this platforms and olny for desktop applications.On something about web application it's even harder.
Alternative is to use a framework like play or something like that, then the best ways to implement it is by adding a new view on the current view.Hard to explain .Try to play Travian for example and you will understand it .



Thanks a lot for your help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic