I'm not sure if you are aware of this but "implementedDevice" is not an instance field, its static. So there will be only one, shared by all classes accessing that variable.

On 13.01.2012 11:05, wahaha wrote:
interface IDeviceDelegate {
     Map<string,IDevice>   implementedDevice;
}

class PrinterDelegate imple IDeviceDelegate {
...
}

class CarderReaderDelegate imple IDeviceDelegate {
...
}


like this above,there is a map element in interface
IDeviceDelegate,how to inject it into the implement classes?
my solution is like this:
1.define one AbstractModule for each implement classes
2.create a Injector for each AbstractModule
3.get map instance by the injectors
4.manually inject the map instance into the implement classes

its seems to complex,is there a simple solution?


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