Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

How to make the program can accept plugins to extend its functionalities?

Thread view: 
www - 09 Mar 2007 22:00 GMT
Hi,

Eclipse can be added more functionalities by adding specific plugins. I
am amazed with such an idea.

We are developing a Java program. Customers always request new
functionalities, after they got the program and used it. I am wondering
if we can make our program like Eclipse. So we can develop many plugins
so that customers can install the plugin if they want such a feature.
Different customers may need different features, so they can pick what
they want.

Is there any tutorial about how to make this kind of Java program? I
have never written a plugin yet. I don't know how to make the main
program to take a plugin.

Thank you.
Thomas Fritsch - 09 Mar 2007 23:24 GMT
> Eclipse can be added more functionalities by adding specific plugins. I
> am amazed with such an idea.
[quoted text clipped - 9 lines]
> have never written a plugin yet. I don't know how to make the main
> program to take a plugin.
Java itself offers a simple, yet powerful plugin technique. It is
described in
<http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#Service%20Provider>
<http://www.javangelist.de/space/Plugin> (in german language)

However, eclipse uses a more complicated technique for their plugins
(involving XML files).

Signature

Thomas

Ashoka! - 10 Mar 2007 03:44 GMT
On Mar 10, 4:24 am, Thomas Fritsch <i.dont.like.s...@invalid.com>
wrote:
> > Eclipse can be added more functionalities by adding specific plugins. I
> > am amazed with such an idea.
[quoted text clipped - 20 lines]
> --
> Thomas

-----------------------------------------
On a more conceptual note to make plug in development possible we use
design patterns such as the "factory pattern" and the "composite
pattern" look these up on wikipedia for details.

The basic idea is instead instead of hard coding anything you get it
at run time from external source.
e.g. If your program has a menu bar on the top you will create a
MenuBar factory class that reads the items that go in this bar from a
configuration file or some other permenant store. And in your event
handling code instead of making a big "if ...else if " clause you will
make generic call to a "Composite Menu Class." This class will already
have loaded event handlers for each item at start up and will call the
corect handler.

I hope this helps some what
regards
Usman Ismail
Christian - 10 Mar 2007 10:21 GMT
www schrieb:
> Hi,
>
[quoted text clipped - 13 lines]
>
> Thank you.

I would recommend you the book   eclipse Rich Client Platform from Erich
Gama..

its about rcp and gives a good explanation of using eclipse's plugin
Framework.

If you just want to have a look at how plugins work you could also
search for a project called  "Java Plugin Framework" its probably
buggy.. but they ripped the plugin framework out of eclipse and put it
in a project..

main adavantage of it is that they have a tutorial for doing plugins ...
and if you want to go back to rcp later, its all the same.

Christian
Roland Pibinger - 10 Mar 2007 11:18 GMT
>Eclipse can be added more functionalities by adding specific plugins. I
>am amazed with such an idea.
[quoted text clipped - 8 lines]
>have never written a plugin yet. I don't know how to make the main
>program to take a plugin.

See also: http://jpf.sourceforge.net/


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.