blu.org  wiki

question on writing extensible code

View: New views
2 Messages — Rating Filter:   Alert me  

question on writing extensible code

by Eric Chadbourne-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.
_______________________________________________
Discuss mailing list
Discuss@...
http://lists.blu.org/mailman/listinfo/discuss

Re: question on writing extensible code

by dj_segfault :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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


_______________________________________________
Discuss mailing list
Discuss@...
http://lists.blu.org/mailman/listinfo/discuss