Is there any way you can hook into the mechanism for getting objects out of this API's locator or wrap it in some way so that you have an opportunity to do something with any instances it creates before using them? If so, you could inject the Injector into a single class that processes those objects by calling Injector.injectMembers(Object) for each object that's created without impacting other code much.
-- Colin On Mon, Sep 19, 2011 at 11:46 PM, Owen Berger <[email protected]>wrote: > Thank you guys for all the responses... > > It looks like the third party API (ESAPI) that I am using utilizes a > Locator class that calls an ObjFactory class that reflectively calls > the getInstance() method of the aforementioned singleton classes > (sorry for the run-on sentence). Therefore, in order to use DI in my > web application, I would need to extend or implement all of the > reference classes of that API, which I am uncomfortable doing as an > amateur developer. Apparently, Dependency Injection is on their todo > list, so I will continue with what I've got (injected servlets/ > filters) and wait for the good guys at OWASP ESAPI to come out with a > game plan on dependency injection and their API. > > Thanks again, I learned a ton trying to implement all of this, and > Dependency Injection is a lot clearer to me after hitting my head > against the proverbial wall (or log errors in netbeans). > > p.s. bklough - Your response wasn't snarky, and I don't offend easy, > in fact I need to know when I am asking the wrong questions. > > -- > 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.
