Updates:
Status: Started
Owner: limpbizkit
Comment #10 on issue 131 by limpbizkit: partial injection a.k.a. factory
generation
http://code.google.com/p/google-guice/issues/detail?id=131
@sberlin, @gili, Don't worry, we'll be keeping FactoryProvider around —
we've got to migrate our own code
too! But going forward we won't be using @Assisted or @AssistedInject
annotations.
--
I reviewed Daniel's FactoryModule(). It's awesome! But as I'd discussed
with Daniel, it doesn't work naturally
with @Provides methods. We could allow the user to opt-out, but in general
I really don't like the idea of the
user seeing a module installed and that module not being installed normally.
So I've changed his API to use builders instead. Here's what it looks like:
bind(SummerCarFactory.class).toInstance(
new
FactoryBuilder().thatMakes(Corvette.class).build(CarFactory.class));
FactoryBuilder has the following API. All methods are optional:
class FactoryBuilder {
public FactoryBuilder();
public FactoryBuilder withModule(Module module)
public FactoryBuilder thatMakes(Class<?> producedType);
public <F> F build(Class<F> factoryType);
}
I'm happy with the builder but the withModule() and thatMakes() method
names could use some lovin'.
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"google-guice-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-guice-dev?hl=en
-~----------~----~----~----~------~----~------~--~---