james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Norman Maurer <nor...@apache.org>
Subject Re: Guicification [WAS Re: [VOTE] Guice a.k.a DI Replacement]
Date Mon, 17 Aug 2009 10:42:12 GMT
Hi Robert,

I think one of the biggest problems with moving to guice is the way
how Avalon is injecting stuff. Currently (for example) the
Configuration and the ServiceManager is injected after the classes are
instanced. But with Guice we would need to have this stuff already
avaible on creation time ( at least from my understanding).

I thought about adding some kind of Wrapper around the our Services
which later decouple our JamesServices ( SMTPServer, POP3Server ...)
from the Avalon Livecycle and Injection. I think we could/should(?)
reuse the Avalon Configuration but just inject it like other services
etc. I'm not sure how well this will work out, but for this we would
prolly need to get sure that stuff handled by Guice will only get
created after the Inialize Livecycle of Avalon was called ( so we are
sure the Configuration and the ServiceManager is already injected).

Thoughts ?


2009/8/17 Robert Burrell Donkin <robertburrelldonkin@gmail.com>:
> <snip>
>
> On Mon, Aug 17, 2009 at 10:57 AM, Norman Maurer<norman@apache.org> wrote:
>> btw do you already have some idea about how this will work ? I saw you
>> already created the sandbox :)
>
> i've been taking a look at guice and remembering the problems in the
> current james code base
>
> complete replacement of avalon by guice is going to be a lot of work
> for a number of good reasons
>
> james has coupling issues at the component and service levels. i don't
> think that these can be solved by guice, and the guice module system
> may well be difficult to use as a service replacement until they are
> resolved.  i started looking at guice in the sandbox but re-started
> working on these problems (again). i think it's probably better to
> sort these issues out on trunk.
>
> i wonder whether it might be better to start by taking on something
> more modest: replacing the ad hoc classloading for handlers and
> mailets with an injection service. i think that PhoenixLoader could be
> used to dynamically bind the services started by phoenix into a guice
> module. guice could then to used to load mailets and handlers injected
> with the services exposed by phoenix plus any other modules loaded.
> the injection service would be used as a bridge between the service
> locator mechanism used by avalon and dependency injection.
>
> - robert
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message