Hi!

I know that this isn't the correct forum for my question, as my
problem is related to Google-Gin, but it may be generic for sharing
instances problem.

I'm using Gin for dependent injection in my application, everything
works great, but I'm not able to inject the Injector instance into my
injected classes. hahaha sounds confusing... :-P

I use Google Guice in my servlets and the below snippet works great:
..

@Inject
public MyServlet(Injector injector)
{
  this.injector = injector;
}

...

My field "this.injector" will have a reference for the Injector that
injected it. I use it to create instances of classes that I need to
create more than once.

But Gin is unable to inject the Ginjector that injected the class.

Currently I created a public static field into my EntryPoint class
containing a reference for my injector, and I use this field
application wide. I think that it's not the best approach, as I'm
creating static dependents.

What is the best approach?

Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" 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-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to