Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Riena » Riena and Guice(Does Riena work with Guice?)
icon5.gif  Riena and Guice [message #816122] Thu, 08 March 2012 12:56 Go to next message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
Hi all,

does Riena work with Guice, i.e., could I use Guice for dependency injection instead of Riena's own DI mechanism?

I know the advantages of Riena's DI mechanism as defined at wiki.eclipse.org/Riena_Getting_Started_with_injecting_services_and_extensions :

Quote:


  • code-based, i.e. no XML configuration files
  • fluent interfaces
  • conventions that simplify the injection definitions.



As I see it, Guice fulfills these requirements pretty well. What would be the disadvantages of Guice in a Riena context? I'm sure there are good reasons why Riena has its own DI.

Thanks,
Uwe
Re: Riena and Guice [message #816153 is a reply to message #816122] Thu, 08 March 2012 13:45 Go to previous messageGo to next message
Christian Campo is currently offline Christian CampoFriend
Messages: 597
Registered: July 2009
Senior Member
Am 08.03.12 13:56, schrieb Uwe San:
> Hi all,
>
> does Riena work with Guice, i.e., could I use Guice for dependency injection instead of Riena's own DI mechanism?
>
> I know the advantages of Riena's DI mechanism as defined at
> wiki.eclipse.org/Riena_Getting_Started_with_injecting_services_and_extensions :
>
> Quote:
>> code-based, i.e. no XML configuration files
>> fluent interfaces
>> conventions that simplify the injection definitions.
>
>
> As I see it, Guice fulfills these requirements pretty well. What would be the disadvantages of Guice in a Riena context?
> I'm sure there are good reasons why Riena has its own DI.
>
> Thanks,
> Uwe
I am starting to play with Guice in another project and get to know. Riena only has its own DI annotations and injectors
but it uses the lifecycle and rules of the underlying extensions (Equinox) and services (OSGi). Both of them have a
dynamic nature, so extensions and services can be added and removed at runtime which requires the Injector to unbind and
bind as it fits.

Guice is very different as it injects components but only at start (AFAIK). Once everything is injected the object model
is rather static. Guice has no real notion for a component that is stopped and there must be unbinded....

Another difference is that multiple services implementing the same interface is something very common in OSGi and
therefor everyfor every component that gets services injected is prepared for this. In Guice this is also possible but
(AFAIK) more the exception. Quit often you will have singletons that get injected and bind..

christian
Re: Riena and Guice [message #816191 is a reply to message #816153] Thu, 08 March 2012 14:39 Go to previous messageGo to next message
Stefan Liebig is currently offline Stefan LiebigFriend
Messages: 124
Registered: July 2009
Senior Member
And Riena also has the capability of injecting extensions via dynamic proxies that map to the underlying representation of extension (extension registry).
And like Rienas service injection this honors the fact that bundles may come and go.

Stefan
Re: Riena and Guice [message #816739 is a reply to message #816191] Fri, 09 March 2012 07:53 Go to previous messageGo to next message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
Christian, Stefan, thanks for your comments. My insights into Riena's DI concept and how it fis into the general context start growing.

Quote:
Another difference is that multiple services implementing the same interface is something very common in OSGi and
therefor everyfor every component that gets services injected is prepared for this. In Guice this is also possible but
(AFAIK) more the exception.


I think this feature is supported by Guice but maybe rarely used. So any Guice user is free to make it more popular.


As I said before: keep up the great work!

U
Re: Riena and Guice [message #816814 is a reply to message #816739] Fri, 09 March 2012 09:39 Go to previous messageGo to next message
Stefan Liebig is currently offline Stefan LiebigFriend
Messages: 124
Registered: July 2009
Senior Member
Uwe,

I guess you are referring to Guices MultiBinders (http://code.google.com/p/google-guice/wiki/Multibindings). Right?
As Christian already mentioned the lack of dynamically binding services in Guice is the reason why Guice is not suitable for Riena.

Stefan
Re: Riena and Guice [message #816930 is a reply to message #816814] Fri, 09 March 2012 12:38 Go to previous messageGo to next message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
Yes, I had MultiBinders in mind.

Are you guys familiar with the peaberry extension for Guice (as described at code.google.com/p/google-guice/wiki/OSGi)? I'm not an expert on this, but it sounds like it provides the support for dynamic services you are referring to in Riena.

[Updated on: Fri, 09 March 2012 12:38]

Report message to a moderator

Re: Riena and Guice [message #817065 is a reply to message #816930] Fri, 09 March 2012 15:41 Go to previous messageGo to next message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
Quick addition to my previous post:

The peaberry guys were inspired by Riena's extension management as they show in this presentation:
www.slideshare.net/mcculls/peaberry-blending-services-and-extensions (on page 20)
Re: Riena and Guice [message #818968 is a reply to message #817065] Mon, 12 March 2012 10:24 Go to previous message
Stefan Liebig is currently offline Stefan LiebigFriend
Messages: 124
Registered: July 2009
Senior Member
Hi Uwe,

We are not really familiar with peaberry. I read about that I while ago and we were happy that we inspired them Wink

Tschüß,
Stefan
Previous Topic:Riena documentation update
Next Topic:Plug-in versions of the Riena toolbox
Goto Forum:
  


Current Time: Fri Apr 19 07:42:23 GMT 2024

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

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

Back to the top