Plugin Framework

V

Vikas

Hi,

I have been programming in Perl for long and at number of places I come
across modules which say they follow a plugin framework and anyone can
plug their plugins (codes) into their software.

Can anyone give me pointers as to how to develop such a software which
supports plugin framework . I mean can I read articles or tutorials about
it somewhere?

Thanks,
Vikas.
 
P

pkent

Vikas said:
I have been programming in Perl for long and at number of places I come
across modules which say they follow a plugin framework and anyone can
plug their plugins (codes) into their software.

Can anyone give me pointers as to how to develop such a software which
supports plugin framework . I mean can I read articles or tutorials about
it somewhere?

I don't know of any good tutorials etc on the subject but here's what
general info I've learnt about such plugin architectures from building
and using them:

* plugins are loaded on demand
* plugins are generally best modelled as classes, so you load the plugin
class and instantiate a plugin object of that class
* plugins conform to a specified API. Some methods may be mandatory,
some may be optional, and so on, but there must be some standard to work
with
* the API can be as simple or as complex as you need. One class of
plugins I wrote has one constructor method (returns a new object), and
one object method (returns 1 or 0) :)
* Inheritance can be very useful. E.g. an X::Y factory class produces
X::Y::Foo and X::Y::Bar (etc..) objects, and those objects inherit some
methods from X::Y, maybe things such as debugging routines, file I/O,
and so on.

If you've got any more details about the kind of plugins and application
you want to write there's probably some more specific pointers.

P
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top