DependenyChain removal

18 views
Skip to first unread message

d3coder

unread,
Mar 12, 2021, 5:04:57 AM3/12/21
to google...@googlegroups.com
Can you please look at this issue? https://github.com/google/guice/issues/1121

> The provided example to replace the deprecated dependency chain method
doesn't provide enough context about which field or parameter is being
injected. I tried to replace dependency chain method, but the most accurate I
got was knowing which method/constructor/class is being injected.

> Knowing which field/parameter is being injected allowed Providers to return
values based on the annotated elements, without having to bind each possible
combination.


Stuart McCulloch

unread,
Mar 14, 2021, 7:43:39 PM3/14/21
to google-guice
One alternative is to use the binding SPI to look over the dependencies of all registered bindings and add additional bindings as appropriate. However this will only work for types that are explicitly bound before the injector is created, it won't work for just-in-time requests. It also relies on you wrapping a module around the application modules to kick off the analysis. It is feasible though - I've used this to provide annotation-driven property-placeholders such as @Named("${expression}")

--
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 google-guice...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/1763681.PJ3cxWoS9r%40arch.
Reply all
Reply to author
Forward
0 new messages