Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursive instantiation? #7

Open
Nachtfeuer opened this issue Aug 14, 2016 · 1 comment
Open

Recursive instantiation? #7

Nachtfeuer opened this issue Aug 14, 2016 · 1 comment

Comments

@Nachtfeuer
Copy link

Nachtfeuer commented Aug 14, 2016

Hi,

If class C is using @Inject B b; and class B is using @Inject A a ...
C c = feather.instance(C.class);
feather.injectFields(c);

If I don't call injectFields I have an instance of class C but 'c.b' is null.
If I call injectFields then I have c.b is not null but c.b.a is null.

Does that make sense? I don't wanna pass the feather instance through
whole hierarchy or using it as singleton and the calling injectFields on
each node in the hierarchy.

Maybe I'm doing something wrong?
Any comments on this?

@ghost
Copy link

ghost commented Aug 15, 2016

If you'd use @Inject in construct this shouldn't happen.

On Sun, Aug 14, 2016, 13:50 Thomas Lehmann [email protected] wrote:

Hi,

If class C is using @Inject https://github.com/Inject B b; nad class B
is using @Inject https://github.com/Inject A a ...
C c = feather.instance(C.class);
feather.injectFields(c);

If I don't call injectFields I have an instance of class C but 'c.b' is
null.
If I call injectFields then I have c.b is not null but c.b.a is null.

Does that make sense? I don't wanna pass the feather instance through
whole hierarchy or using it as singleton and the calling injectFields on
each node in the hierarchy.

Maybe I'm doing something wrong?
Any comments on this?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#7, or mute the thread
https://github.com/notifications/unsubscribe-auth/AMjsL-3dYiEGzveLiJfskadYH3D_gFSCks5qfw8igaJpZM4Jj4-I
.

Egidio Caprino
Software Developer, Cloudreach Europe
[t] +44 20 7183 3893 <00442071833893> (ext. 416)
[m] +44 7481 908 139 <0044+7481+908+139>

Not if. When. http://goo.gl/YjdhZv

The above terms reflect a potential business arrangement, are provided
solely as a basis for further discussion,
and are not intended to be and do not constitute a legally binding
obligation. No legally binding obligations
will be created, implied, or inferred until an agreement in final form is
executed in writing by all parties involved.

This email may be confidential or privileged. If you received this
communication by mistake, please don't forward
it to anyone else, please erase all copies and attachments, and please let
us know that it has gone to the wrong person.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant