plugin / intra process communication system

Paul Kölle paul at subsignal.org
Sun Feb 14 10:16:18 CET 2010


Am 13.02.2010 10:50, schrieb Florian Ludwig:
> Hi,
>
> I'm looking for a module/plugin/intra-process-communication/hook system
> for python. Maybe someone here could point me to some project I missed
> or might have some good ideas if I end up implementing it myself.
>
> Most systems I have found are "one to many" communications but I would
> like "many to many", to clarify what I mean an *example* use-case:
>
>          Lets say you program a wiki and like to allow different kind of
>          authentications. So you create two plugins (for example one for
>          OpenID and one for Shibboleth).
>
>          Some time later you feel like reinventing the wheel again and
>          you program a blog. Again you like to allow different ways of
>          authentication and you already wrote plugins for exactly the
>          same for your wiki, right?
>
> With most systems now some trouble begins - the blog software would need
> to have the interface/extention-points/however-you-name-it that the wiki
> software defined.
>
> The plugins you wrote probably import them from the wiki module directly
> which means your blog would depend on the wiki. (?!) So where to put the
> interface/[...] definition that is imported by those plugins? Create a
> package/module just containing the interface? This really get
> troublesome if different people wrote the wiki, the blog and another
> third one a plugin.
If you are talking about code sharing you can move the common code out 
of your applications in a seperate namespace. If you follow the model 
trac is using you would install a module/package/egg with the basic 
functionality of the pluginsystem (i.e. what's in core.py and env.py + 
logging and whatever you think is necessary).
All shared code like your auth-plugins would go in a common plugin 
directory to which you can refer via PYTHONPATH.

Another common technique is chaining of WSGI middleware..., check out 
pythonpaste.org.

Then there is SOA where functionality is shared via RPC/webservices and 
wsdl/uddi. But my feeling is this is mostly used in "Enterprise" 
applications and is best used in Java/.NET where you already have 
libraries doing all the XML stuff.

hth
  Paul







More information about the Python-list mailing list