> Here is a (really) quick overview of Envisage's new plugin/extension 
> mechanism...

Thanks!

> class MyPlugin(Plugin):
>     ...
>     foos = ExtensionPoint(List(IFoo), id='myplugin.foos')
> [...]
> class SomeOtherPlugin(Plugin):
>      id = 'someotherplugin'
>
>      @extension_point('myplugin.foos')
>      def get_foos(self, application):
>          """ Return my contributions to the foos. """
>      return [Foo1(), Foo2(), Foo3()]

I'm guessing the indention on this line should have been:

>          return [Foo1(), Foo2(), Foo3()]

> And that's it! I think we now have a pretty simple, but powerful plugin and
> extension mechanism, and Envisage applications are simply built from a
> collection of plugins (by default we use Python Eggs to find them, but that it
> not a requirement)...

This does look interesting.  Looking at the code, you have a single
object that implements the IApplication interface that's your main
code.  You can find plugins using the get_plugins method giving the
plugin's ID, extension points by the get_extensions method, and
services you can also query by some means that I haven't figured out
yet.

So, plugins are in effect singletons.

When you use MyPlugin.foos as in your example above, you get a list of
stuff conforming to the IFoo interface.  Is this resolved during the
call to that method, or is it resolved only once upon plugin load?  I
mean: can you add plugins later?

I've looked at enthought before, and the barrier to entry for me has
always been the build process and the large number of dependencies.  I
see that you guys now distribute Python 2.5 modules, so that's good,
but prior to that I was stuck on windows and didn't want to downgrade
to python 2.3 to support enthought so I tried compiling under cygwin.
Don't need to tell you how that turned out. :)

I actually like all the tools offered (numpy, scipy, etc) but some may
not.  It would be cool if there were more separable versions that
didn't require, say, VTK.  The wiki seems to indicate that you can
build only parts of the toolkit, so maybe my point isn't valid any
more.  Can you just use envisage and traits?

Rob

Reply via email to