Comment #21 on issue 131 by sberlin: partial injection a.k.a. factory  
generation
http://code.google.com/p/google-guice/issues/detail?id=131

It's good to see AssistedInjectV2 checked in, but I think the draft that's  
checked
in now is a significant step down from Daniel's patch.  It loses the  
functionality
of being able to have a factory that can return different things, support  
sub-
interfaces that return different things, or arbitrarily bind Assisted  
parameters
during factory-creation that may be required by the assisted class (but not  
the
factory).

OTOH, it does support all current AssistedInject usecases.

I'd like to see the Daniel's API introduced as a way of supporting the  
things this
draft lacks, but perhaps as an addition to this draft instead of a  
replacement.  It
seems it'd just need reintroduction of 'binder.install(new FactoryModule
(MyFactory.class));' as a means of binding.

While AOP is nice, I don't use it internally -- the one features that  
really stood
out to me from Daniel's patch was support for multiple methods returning  
different
types.  That is,
    FooFactory {
         SimpleFoo createSimple(@Assisted String name);
         ComplexFoo createComplex(@Assisted String name);
    }
    Although I didn't actually run his code, from scanning the patch it  
looked like
it would support this.  It's very useful to have a factory that can return  
different
(but similar types) and not have to create a factory for each method.

-- 
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to