I am no expert on Guice (only been using it for a few days), so I dare
not comment. However, you posted on Friday, at least give it another
day or two.

--
Thomas Suckow



On Sun, Feb 12, 2012 at 10:41 PM, egolan <[email protected]> wrote:
> anyone?
>
> On Feb 10, 4:34 pm, egolan <[email protected]> wrote:
>> Hi,
>> I would like to consult whether the way I constructed my modules is
>> the preferred way.
>>
>> I created a module for each part of the application (a Guice Abstract
>> module for some logic module in the application).
>> I have a main module that in its configure method, it uses
>> install(...) method.
>> The main class calls this module and the Guice.getInjector() and run
>> what it need to run.
>>
>> One of the sub module is not created in the main module, but instead
>> the main creates it and call the main module with it.
>> I did it to allow me to do an end2end test with the main module, but
>> with a different sub module.
>>
>> Main module:
>> public MpsModule(Properties properties, MpsServiceModule
>> moduleForMpsService) {
>>         this.properties = properties;
>>         this.moduleForMpsService = moduleForMpsService;
>>     }
>>
>>     @Override
>>     protected void configure() {
>>         Names.bindProperties(binder(), properties);
>>         convertToTypes(dateMatcher(), dateConverter());
>>         install(new MpsBizModule());
>>         install(new MpsLogicModule());
>>         install(moduleForMpsService);
>>         install(new
>> ConfigurationModule(MpsConfigurationName.MpsLastProcessingTime.name()));
>>     }
>>
>> Here's the sub module that I have different implementation for using
>> different service:
>> (MpsServiceModule just extends Module)
>> public class MpsServiceModuleImpl extends AbstractModule implements
>> MpsServiceModule {
>>     public MpsServiceModuleImpl() {
>>         System.out.println("----------------- MpsServiceModuleImpl
>> -----------------");
>>     }
>>
>>     @Override
>>     protected void configure() {
>>
>> ThrowingProviderBinder.create(binder()).bind(MpsServiceProvider.class,
>> IProductMatchService.class).to(
>>                 MpsServiceProviderImpl.class);
>>     }
>>
>> }
>>
>> Any comments?
>>
>> Thanks,
>>
>> Eyal
>
> --
> 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.
>

-- 
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