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

Discussion in 'Java' started by www, Mar 9, 2007.

  1. www

    www Guest

    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.
    www, Mar 9, 2007
    #1
    1. Advertising

  2. www wrote:
    > 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.

    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).

    --
    Thomas
    Thomas Fritsch, Mar 9, 2007
    #2
    1. Advertising

  3. www

    Ashoka! Guest

    On Mar 10, 4:24 am, Thomas Fritsch <>
    wrote:
    > www wrote:
    > > 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.

    >
    > 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).
    >
    > --
    > 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
    Ashoka!, Mar 10, 2007
    #3
  4. www

    Christian Guest

    www schrieb:
    > 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.


    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
    Christian, Mar 10, 2007
    #4
  5. On Fri, 09 Mar 2007 17:00:09 -0500, www <> wrote:
    >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.


    See also: http://jpf.sourceforge.net/
    Roland Pibinger, Mar 10, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tobi
    Replies:
    0
    Views:
    330
  2. Big George
    Replies:
    2
    Views:
    302
    Big Charles
    Oct 28, 2006
  3. thunk
    Replies:
    1
    Views:
    303
    thunk
    Mar 30, 2010
  4. thunk
    Replies:
    0
    Views:
    469
    thunk
    Apr 1, 2010
  5. thunk
    Replies:
    14
    Views:
    612
    thunk
    Apr 3, 2010
Loading...

Share This Page