Hi, I have used Guice now for several months and have found it incredibly productive to work with.
However I have run into a problem, which is variation on the 'robot legs' problem I suppose. I have a set of objects forming part of an application, that function as a module. A number of those objects must be Singletons and I have scoped them as such in the Module declarations. However I now need to be able to run multiple instantiations of the module with different configuration parameters. I am currently working on the premise that I need child injectors. This involves having child injectors that contain more global scope and then child injectors from those injectors. Like configuring the 'toes' in the 'robot legs' ! There is also the requirement that extra instantiations are generated on-the-fly at runtime. There are a couple of types of object that needs to be singletons in each instance of the injector, so one instance in each 'leg' and one instance in each 'toe'. I have not been able to work out how to achieve this. If I declare it a singleton in the leg injector, then I cannot get new singletons in the toes. Since these graphs are generated at runtime I cannot use @Named or have different subclasses. Does anyone have ideas on how I can achieve my goal. Regards, Martin Pike -- 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.
