Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

question on writing extensible code



> any suggested reading on this?  i'm particularly interested allowing
> customers to write their own modules and in handling upgrades.  i've
> gotten some ideas from several free software projects but it would be
> enjoyable to read up on the topic.
>
> thanks for any tips,
> eric c.

What you're looking for is some kind of plugin architecture.  I've tried
to do this from scratch, and the biggest obstacle is that there's no way
in Java to enumerate all the classes in a package, all the classes that
extend another class, or all the classes that implement an interface. 
These classes have to register with your handler somehow.

If you're looking for a larger, more robust solution, Eclipse and OSGi (or
some other OSGi stack other than Equinox, which is what Eclipse uses) is
all about that kind of thing.  I'm using it at http://www.metatomix.com,
and it works well.  Each Eclipse plugin you write has its own class
loader, and can publish as few or as many classes as it wants.  There's a
mechanism called Extension Points for doing exactly what you're talking
about (a plugin can say "I provide Foo functionality, so count me in the
list if you're looking for implementers of Foo".

Eclipse also allows you to have different versions of the same plugin
accessible at the same time.








BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org