Re: New in git head: OptionalBinder

2014-07-14 Thread Sam Berlin
FYI, I submitted an improvement https://github.com/google/guice/commit/842f351c4b2b3b0a90d9f3bcf164d8fd19aede6c to this the other day so that when frameworks call *OptionalBinder.newOptionalBinder(binder(), Foo.class)*, then users can supply the binding by just calling

Re: New in git head: OptionalBinder

2014-04-02 Thread Tavian Barnes
I like it, similar to what Dagger has for @Provides(SET). I also really like OptionalBinder. Previously I used Modules.override(new OverridableBindingsModule(), ...) to provide default implementations. On Wednesday, 2 April 2014 09:41:45 UTC-4, Sam Berlin wrote: I've been thinking also about

Re: New in git head: OptionalBinder

2014-04-02 Thread Nate Bauernfeind
I'm very excited about this; are you going to cut another beta release anytime soon? Is it possible to extend this to use other wrapper classes? I'd like to add this to the Scala-Guice project for Scala's option class if possible. On Apr 1, 2014 7:33 PM, Sam Berlin sber...@gmail.com wrote: Ever

Re: New in git head: OptionalBinder

2014-04-02 Thread Sam Berlin
No way to extend it to provide other wrapper classes, no. Although you could pretty easily write a wrapper around it (e.g, ScalaOptionBinder) that binds your custom wrapper to something that delegates to OptionalT (and OptionalProviderT, etc.). That'd require users to use your wrapping binder,

Re: New in git head: OptionalBinder

2014-04-02 Thread Christian Gruber
Yeah - I can see Dagger borrowing back the approach for Optional provides, though having no access to an Optional in dagger is tricky (targeting Java6 without non-JSR dependencies, like Guava). We'll have to figure it out. At least we might be able to do the default approach though. c. On

Re: New in git head: OptionalBinder

2014-04-02 Thread Christian Gruber
Let's get the OSGI fix in, and THEN cut beta5. c. On 2 Apr 2014, at 10:57, Sam Berlin wrote: No way to extend it to provide other wrapper classes, no. Although you could pretty easily write a wrapper around it (e.g, ScalaOptionBinder) that binds your custom wrapper to something that

Re: New in git head: OptionalBinder

2014-04-02 Thread Thomas Suckow
We can likely make this work for scala-guice in a similar manner to the Multibinder wrapper. Thomas Suckow On Wed, Apr 2, 2014 at 11:09 AM, Christian Gruber cgru...@google.comwrote: Let's get the OSGI fix in, and THEN cut beta5. c. On 2 Apr 2014, at 10:57, Sam Berlin wrote: No way to