Hi,
is the following possible with Guice?

class A
{
   @Inject
   private SqlSession session;
}

class B
{
    private A a;

    public B()
    {
          a = new A();
    }
}

class C
{
     public static void main()
     {
         ...
         B b = injector.getInstance(B.class);
     }
}

I have a provider binded to class SqlSession. My problem is that
session field in class A is not injected. Should I create injector in
constructor of B and get instance of A from injector? Isn't it then
easier to avoid Guice at all? I'm confused.

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