You are not logged in.

#1 2005-06-08 12:56:33

FUBAR
Member
From: Belgium
Registered: 2004-12-08
Posts: 1,029
Website

How to make your program support plugins

I'm thinking of writing yet another FTP client for Linux. One with a fancy GUI and features like queueing and FXP. Basically, I'd just like to make a freeware ripoff of FlashFXP for Win32.

I figured it would be cool to have plugin support, so users can add their own new functions. The only thing is, how is something like that possible? So far my only OO experience is with Java and all I can think of is to provide an interface to the "most important methods" so the plugins can make use of those.

Could some please give me a little info on the plugin approach?


A bus station is where a bus stops.
A train station is where a train stops.
On my desk I have a workstation.

Offline

#2 2005-06-08 13:23:20

cmp
Member
Registered: 2005-01-03
Posts: 350

Re: How to make your program support plugins

you would need to export certain core function of your application and then maybe provide some inter plugin communication mechanism.
you could also provide hooks. for example, if someon tries to connect the connection objects is passed to the hook, which can change certain parts and then just return it.
but it all depends on what you want to do.

Offline

#3 2005-06-08 14:07:54

max_sipos
Member
From: Ithaca, NY
Registered: 2004-10-31
Posts: 106
Website

Re: How to make your program support plugins

You might want to look into extending the program with languages such as guile, ruby or python. That could be simple for users to create their own plugins. However, since you are building the program in java, I'm not sure how to create the necessary bindings.

Offline

#4 2005-06-08 14:19:14

FUBAR
Member
From: Belgium
Registered: 2004-12-08
Posts: 1,029
Website

Re: How to make your program support plugins

Whoaaah, I'm not building anything yet! wink I've currently got my exams to worry about. I'll start the coding next month.

max_sipos, simply allowing the use of different languages isn't really a solution (I think). And I don't really understand the "hook" concept, cmp. I'm still a noob actually, maybe I'd better read some more OO-books.


A bus station is where a bus stops.
A train station is where a train stops.
On my desk I have a workstation.

Offline

#5 2005-06-08 14:40:10

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: How to make your program support plugins

FUBAR wrote:

So far my only OO experience is with Java and all I can think of is to provide an interface to the "most important methods" so the plugins can make use of those.

Could some please give me a little info on the plugin approach?

If you're going to be coding in Java, you have to take a look at the JEdit Plugin API. (http://www.jedit.org/). Its the most extensible API I've seen.

Dusty

Offline

#6 2005-06-08 18:14:25

max_sipos
Member
From: Ithaca, NY
Registered: 2004-10-31
Posts: 106
Website

Re: How to make your program support plugins

I'm sorry, what I meant was use such a language for the plugins themselves. Sort of like how emacs uses emacs-lisp, jed uses slang, etc. So, what you need to provide is the bindings of that language to the core functions of your program.

This is easier to deal with, than say have some sort of compiled .so architecture, and might provide an easy-to-make plugin functionality to your program. In fact, that is one of the primary points of GNU guile.

Offline

Board footer

Powered by FluxBB