Hello all.

Lets say I have:

class A {
//...
}

class B {
    A getA() {
        // Building a A using B attributes
    }
//...
}

I'd love to write:

class B {
    private final a;

    @Inject
    private B(A a) {
        this.a = a;
    }
//...
}

But, since the building of the A instance relies on some data from B, I can 
not.
Typical exemple would be two classes mapping two SQL tables, where getA() 
is following a foreign key.

Is there a way Guice can be used around here? (Factory that uses "this", 
something like that)
Perhaps is it a silly question, and I should do my "new" thing as I would 
if Guice wasn't around; but it is, so I'm trying to find the proper answer 
here.


Adrien.

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-guice/061aeb37-8183-45f5-8d17-227ae8604110%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to