> I understand that injection would cascade down if object is created > with @Inject instead of constructor "new". > However, > 1) In my case, my local object of type "Person" has to be created > using reflection. Is it still possible to have FoodFactory injected?
You can inject classes after they have been instantiated using new. It's something like Inject.injectMembers or something like that. > > 2) Even if my local object is created with a regular "new", I also do > not see how the code can be converted to have FoodFactory injected. > Is it true to say that injection would stop cascading when "new" is > called in the object creation graph path? > In general, I don't see how injection can work on object created > locally since it is not a member field. Yes, but you can always apply injection later if you have to. Or, just stop using 'new' everywhere and use the Injector instead. I'd definitely use it in that dynamic loading loop you have there. -bp --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
