Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Inversion Of Control And Plugins
Inversion Of Control And Plugins [message #436340] Tue, 06 September 2005 14:17 Go to next message
Jacob Robertson is currently offline Jacob RobertsonFriend
Messages: 21
Registered: July 2009
Junior Member
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...
Re: Inversion Of Control And Plugins [message #436341 is a reply to message #436340] Tue, 06 September 2005 15:06 Go to previous messageGo to next message
Neil Bartlett is currently offline Neil BartlettFriend
Messages: 93
Registered: July 2009
Member
I also had this requirement (ie to integrate Spring-managed resources into
an RCP application). There is a solution involving
IExecutableExtensionFactory, which means you can configure your views etc
inside a Spring bean factory using full DI/IOC, and then "point" Eclipse
at the beans from the plugin.xml. No singletons in sight!

I have created a project on SourceForge for the solution I ended up
building, hosted at http://sourceforge.net/projects/eclipse-spring/. If
you download the zip you will find a sample inside along with the source
code.

Kind regards,
Neil Bartlett


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...
Re: Inversion Of Control And Plugins [message #436364 is a reply to message #436341] Wed, 07 September 2005 12:41 Go to previous messageGo to next message
Jacob Robertson is currently offline Jacob RobertsonFriend
Messages: 21
Registered: July 2009
Junior Member
Thanks Neil.

I've downloaded it and started looking through it. I may have some
questions for you once I try and actually use it, but I wanted to let you
know I've started working on this, and say thanks.

Jacob
Re: Inversion Of Control And Plugins [message #436365 is a reply to message #436340] Wed, 07 September 2005 13:09 Go to previous message
Eclipse UserFriend
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...
>
>
Previous Topic:Dynamically update editors title
Next Topic:Resources on remote server
Goto Forum:
  


Current Time: Thu Dec 26 15:15:09 GMT 2024

Powered by FUDForum. Page generated in 0.04094 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top