Comments on: Assisted Injection in Guice http://v1.ripper234.com/p/assisted-injection-in-guice/ Stuff Ron Gross Finds Interesting Sun, 02 Aug 2015 11:03:35 +0000 hourly 1 https://wordpress.org/?v=4.5.3 By: ripper234 http://v1.ripper234.com/p/assisted-injection-in-guice/comment-page-1/#comment-5204 Sat, 11 Feb 2012 11:13:31 +0000 http://v1.ripper234.com/?p=1539#comment-5204 @Doug – I don’t believe you can do that (at least without ugly hacks like changing the “final” property of the field with reflection). Assisted injection is just a shortcut – if you can’t achieve this via a full-fledged Factory class, then assisted injection won’t help you.

Try asking on Stack Overflow though, there might be something I missed.

]]>
By: Doug http://v1.ripper234.com/p/assisted-injection-in-guice/comment-page-1/#comment-5199 Sat, 11 Feb 2012 05:40:25 +0000 http://v1.ripper234.com/?p=1539#comment-5199 Can you show how to use this assist technique to set a final variable?

As far as I can tell, Guice uses constructors that DO NOT set the final variable (because your build() method will set it). But if your constructor doesn’t set the final variable, the compiler stops you.

How are you getting around not having a constructor set the final variable?

]]>
By: A Quantum Immortal » Blog Archive » MapBinder basics in Guice http://v1.ripper234.com/p/assisted-injection-in-guice/comment-page-1/#comment-4155 Sat, 03 Sep 2011 21:23:51 +0000 http://v1.ripper234.com/?p=1539#comment-4155 […] Assisted Injection in GuiceMapBinder basics in Guice4/9/11, 0:22 (No Ratings Yet) Loading …Another less known feature in […]

]]>
By: ripper234 http://v1.ripper234.com/p/assisted-injection-in-guice/comment-page-1/#comment-4027 Thu, 04 Aug 2011 13:07:21 +0000 http://v1.ripper234.com/?p=1539#comment-4027 @Ken – you’re right, .Net has come a long way in the last few years.
Nice to see this use case for anonymous classes. I should really try out scala some time.

]]>
By: Ken Egozi http://v1.ripper234.com/p/assisted-injection-in-guice/comment-page-1/#comment-4026 Thu, 04 Aug 2011 12:50:41 +0000 http://v1.ripper234.com/?p=1539#comment-4026 you only need … factory … annotate… tell guice…

sigh

Java is so tiresome even with reasonably good tooling.

.NET frameworks allow stuff like .Resolve(new{numberOfRetries=3}) and really be done with it. I’d bet that scala would support it

]]>