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
Disable Just-in-time bindings #342
Comments
From limpbizkit on February 28, 2009 13:30:10 Most applications use a huge number of JIT bindings. Every time you do a linked binding: Rather than throwing out JIT bindings (which are generally useful), I think we want to add a configuration to Summary: Disable Just-in-time bindings |
From crazyboblee on February 28, 2009 13:58:06 I'm just talking about JIT bindings from the user's perspective, not how it's For bind(Foo).to(FooImpl), we'll materialize the JIT binding under the covers either way. But, if FooImpl has a no-arg constructor and the user tries to inject FooImpl bind(FooImpl.class); |
From dolphin.wan on March 03, 2009 08:09:53 Looks like a user also wants to be explicit in specifying bindings: http://www.jroller.com/joshua_davis/entry/a_small_guice_gotcha |
From sberlin on March 03, 2009 08:11:51 I'd like to disable bindings too, actually. In my case, I'd like to disable anything |
From sberlin on October 04, 2009 13:29:39 Took a stab at this this weekend (because having it enables some nice optimizations - InternalFactory.get has a new 'linked' method. True if you're getting as a result - InjectorImpl.getJustInTimeBinding & getBindingOrThrow has a new 'allowJit' - ConstructorBindingImpl.create & Factory take a new 'failIfNotLinked' parameter To apply the patch, first copy InjectorBuilder to InjectorBuilderImpl, then apply the I tested the patch out on LimeWire's codebase & we had ~100 JIT bindings that failed, Attachment: gist |
From limpbizkit on October 04, 2009 20:16:56 Sam, this is awesome. I'm going to catch up on Guice stuff on Monday; this will certainly |
From sberlin on October 05, 2009 07:17:24 Re: Bob's comment, "Could we just add a disableJitBindings() method to Binder?" -- Re: some other things.. I realized last night that there's a small oversight in the Without the change, getBinding can be used to bypass disabling of JIT bindings. |
From crazyboblee on October 05, 2009 08:02:55 The Stage param predates Binder. I actually do wish it was set on the Binder, too. The |
From sberlin on October 05, 2009 08:42:19 I suppose it could find a home next to Scopes & the like. Still think it'd be a |
From sberlin on November 05, 2009 06:21:00 Any progress on this? The submitted patch not OK for some reason? |
From Maaartinus on November 07, 2009 16:27:57 I've got a probably naive idea: What about binding a JitBindingListener? It could do |
From sberlin on November 17, 2009 08:10:25 All -- are there any plans to incorporate this patch (or something similar to it)? Re: binding listeners, take a look at issue 387 . The patch doesn't distinguish |
From sberlin on February 11, 2010 14:10:50 fixed in r1141 . right now an InjectorBuilder is used to expose the ability. that Status: Fixed |
From crazyboblee on February 28, 2009 13:33:54
Automatically generating constructor bindings at run time oftentimes
results in subtle bugs. Many people prefer to explicitly bind everything in
their modules, and they want an error if they forget to bind something.
Original issue: http://code.google.com/p/google-guice/issues/detail?id=342
The text was updated successfully, but these errors were encountered: