It helps to define simple terms:
* library module
* application module

A "library module" is a module that binds implementation classes within a
resuable library, such as a library that would implement monitoring
constructs.  In an application, all modules except for one should be
construed as "library modules."

The exception is the "application module", which will effectively collect
all install the library modules that represent the configurations of each of
the libraries that it executes within it.  This top-level module serves as
the main reference of configuration of an application:  it should be simple
to ascertain which versions of each library are installed within
an application based on this module.

Your main() function should then install the application module, create an
injector, get an instance of the class that holds application's true
starting point, and then start the application (e.g., this would start up a
http server).

Hence it is within your application module that modules A, B, and C will be
installed.  There should be no lateral dependencies among these, lest an
unsortable web of installations be created.  For instance, if module B
installed module A, and module C also installed module A, then you'd get
duplicate bindings.

When you construct the application module you will know that your
configuration of library B depends on library A, and ditto for the C => A
relationship.  You will then be able to install module A exactly once, and
know that both libraries B and C will have their dependencies on A
satisfied.

On Mon, Jan 18, 2010 at 7:26 PM, Drink Guice <[email protected]> wrote:

> In my application, I have 3 modules - A, B, and C. Module A is
> independent of any other modules. This is easy to develop and test.
> However, modules B and C depends on some services from module A.
> Modules B and C do not depend on each other. What is the best way to
> handle modular dependencies among modules with Guice? Thank you very
> much for your help!
>
> --
> 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]<google-guice%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-guice?hl=en.
>
>
>
>
--
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