On Tue, Feb 16, 2010 at 5:28 AM, mk <[email protected]> wrote:

> Hello everyone,
>
> I need to write a rather large web app using Pylons.
>
> I'm trying to work out if it could be written as a series of plugins, some
> of them realizing "core" functions, and some being addons, e.g. Email
> Management or FTP Management would be core plugins and Accounting could be a
> third-party plugin, working e.g. with FTP Management to calculate e.g.
> bandwidth used by FTP.
>
> To give you some idea why I would try to do it this way:
>
> 1. Modularity. Separating, say, Accounting from Email Management makes
> sense on an architectural level.
>
> 2. Extensibility by third parties. In order not to end up with
> unmaintainable mess, communication between plugins should be handled via
> some service interface over some sort of established protocol (I think).
>
> I was thinking that even the main page could just be a display page for
> content produced by particular plugins (would template inheritance in Mako
> be useful for this?).
>
> I found this:
>
>
> http://wiki.pylonshq.com/display/pylonscookbook/Using+Entry+Points+to+Write+Plugins
>
> But I'm not sure eggs would suffice: I would like to be able to register
> plugins dynamically while the Pylons app is running and to be able to
> dynamically create pages querying plugins from somewhere (the plugin data
> could even be contained in SQLA backend).


I've been having some luck using the Component Architecture from trac to
enable much of what you're looking for (aside from dynamically loading
things while the site is running)

The plugins are loaded when the site starts, and they all load their own
controllers, and sqlalchemy models, and append their own routes and search
path for templates.



> Say, the main app page queries plugin list, and asks each plugin to create
> HTML content for its part of the page in specified context (say,
> 'mainpage'), then displays the whole thing.


I've reversed what you describe here though. I have each plugin provide
named pieces of content that return HTML... and if your 'mainpage' would
like to display a particular widget, it asks for it. If that widget doesn't
exist, nothing is rendered.

So instead of the page asking plugins to display what they want, the page
tells the plugins what it wants, if it's available.

--
Brennan

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to