|
|
|
Re: Inversion Of Control And Plugins [message #436365 is a reply to message #436340] |
Wed, 07 September 2005 13:09 |
Eclipse User |
|
|
|
Originally posted by: Paul.Helster.gmail.com
I have built an RCP app that has a plugin with views (plugin "A") that
display a repository of some sort. The repository is identified at
runtime and is supplied by another plugin. I am not using the singleton
pattern for that at all.
* Plugin "A" defines an extention point: RepositoryFactory
* Plugin "B" (and possibly other plugins as well) implements this
extension point.
Plugin "A" looks for all plugins that support this extension point and
selects the first it finds, or looks in its preferences to use the last
one used.
When testing, it is easy to "force" the use of a specific repository by
just having this one available, or by setting it in the preferences.
Not sure if this is _purely_ in the line of what you need, but it works
just fine for me.
--
ph
Jacob Robertson wrote:
> I'm working on an RCP project, and I've written a plugin with a few views
> just to get the ball rolling, but the time has come to design the overall
> architecture of our app, and one of our design principles is using Spring to
> inject dependencies instead of doing some sort of Singleton/Service Lookup
> pattern. I've tried to figure out if there's a way to do this using the
> Eclipse API, but it looks like every code example I've seen is forced to
> call to the singleton plugin object and pull its dependencies from there.
> Does anyone have some advice or examples where we can use IoC/DI with
> plugins and views? Thanks in advance...
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04094 seconds