I have this scenario:

I have an application which currently uses reflection and factories to
construct components from some of a dozen different packages using
some config and some reflection.  Each set of components may be in use
simultaneously.  Each package has an identical config schema.

I've started getting this under Guice by introducing Guice within one
of the packages.  I'd like to "pull it up" and make a global injector,
but I'm not sure the best way to do it.  Here's my thinking so far:

There are several different expectations that need to be injected into
each set of components (a ServiceID, a ProcessorConfig, a
ProcessorConfigEx (yes, I know), many type bindings (CommProcess,
StreamDelineator, CommType) which come from hand-coded factories at
the moment).  So, I have a situation where:

1. I need a parameterized, private module to collect and inject all
these dependencies.
2. I need specific code for each module to inject non-config dependencies.

Ideally, I'd like to have a module implementing 2 inheriting from a
module implementing 1, or otherwise delegating or composing.

My understanding is that Guice doesn't have inheritable namespaces or
sub-modules really, so all I can think of is making an abstract base
module from which each component module derives.  I'm not fond of this
solution - is there something better?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.

Reply via email to