On 24/09/10 10:41, Johannes Schneider wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Use methods annotated with @Provided.
In my opinion those methods are really good. A little bit verbose
They are typically way less verbose than the TypeLiteral-approach.
At least in the cases where i use them.
- but
that is a good thing when using Generics... At least I am still able to
read and understand those bindings after some time...


On 09/23/2010 04:35 PM, Christian Goudreau wrote:
Anyone else ?

On Wed, Sep 22, 2010 at 11:34 AM, Christian Goudreau
<[email protected]<mailto:[email protected]>>  wrote:

     bind(MemberView.MyUiHandlers.class).to(MemberPresenter.class);


      
bind(UiHandlersStrategy.class).annotatedWith(ProviderUiHandler.class).to(ProviderUiHandlersStrategyImpl.class);


     
bind(UiHandlersStrategy.class).annotatedWith(SetterUiHandler.class).to(SetterUiHandlersStrategyImpl.class);

     public interface UiHandlersStrategy<H extends UiHandlers>  {

       void setUiHandlers(H uiHandlers);

       H getUiHandlers();

     }

     public class ProviderUiHandlersStrategyImpl<H extends UiHandlers>
     implements

         UiHandlersStrategy<H>  {

       private final Provider<H>  uiHandlersProvider;


     Here's more informations. What I don't get is that MyUiHandlers is
     declared... but my guest is that it is AFTER the other one...

     Cheers,


     On Wed, Sep 22, 2010 at 11:16 AM, Fred Faber<[email protected]
     <mailto:[email protected]>>  wrote:

         Can you post your binding?

         You should be able to do this with something to the effect of:

         bind(new TypeLiteral<UiHandlersStrategy<MyUiHandlers>(){})
           .to(...your impl);

         -Fred

         On Mon, Sep 20, 2010 at 5:10 PM, Christian Goudreau
         <[email protected]
         <mailto:[email protected]>>  wrote:

             Humm I think my subject is weird... anyway :D

             Here's what I want to do:

               @Inject

               public MemberView(@ProviderUiHandler final
             UiHandlersStrategy<MyUiHandlers>
             providerUiHandlersStrategyImpl) {

             My error:
             17:02:42.928 [ERROR] [apapul] No implementation bound for
             key
             
Key[type=ca.ulaval.apapul.client.mvp.strategies.uihandlers.UiHandlersStrategy<ca.ulaval.apapul.client.core.member.MemberView$MyUiHandlers>,
             [email protected]]

             MyUiHandlers is also an interface binded by Gin/Guice. Using
             the implementation class instead the interface work, but I
             wanted to use the interface with an annotation.

             Btw, is this worth the pain ? That seem to be almost as if I
             was using the implementation class anyway...

             Thanks and cheers,

             --
             Christian Goudreau
             www.arcbees.com<http://www.arcbees.com>

-- You received this message because you are subscribed to the
             Google Groups "google-guice" group.
             To post to this group, send email to
             [email protected]
             <mailto:[email protected]>.
             To unsubscribe from this group, send email to
             [email protected]
             <mailto:google-guice%[email protected]>.
             For more options, visit this group at
             http://groups.google.com/group/google-guice?hl=en.


         --
         You received this message because you are subscribed to the
         Google Groups "google-guice" group.
         To post to this group, send email to
         [email protected]
         <mailto:[email protected]>.
         To unsubscribe from this group, send email to
         [email protected]
         <mailto:google-guice%[email protected]>.
         For more options, visit this group at
         http://groups.google.com/group/google-guice?hl=en.




     --
     Christian Goudreau
     www.arcbees.com<http://www.arcbees.com>




--
Christian Goudreau
www.arcbees.com<http://www.arcbees.com>

--
You received this message because you are subscribed to the Google
Groups "google-guice" 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?hl=en.
- -- Johannes Schneider - blog.cedarsoft.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBAgAGBQJMnGREAAoJEAytD9R7Qv6dOksIAMinVSjEBjU2omN7AFci9qnW
pxSdZTDOVT8N0vPbCk7ZYb//h5SjkyGqCP5OJhw6UHEW7Ob04bcw7bJppJpaWN6X
zRfatns0r7wUzGMBnF/HtqF91wW80DbMbkQf6UIAR5KXvWaBRdRUIj5p5ly4qfPC
xUqvKz1wRWcUIBu8bsY5KqVNQSMHIiLj/uS01KeDNNZ6ML+Hlk2E0BUlpXA113nJ
FlvOv5sUHpBmpwDFiaefIL3BQ66QRf2NEnMlMk/AVWzqecwIxuf9YjHvHHatzj+J
8ZoLHUxzFsDRpIppZF5sEI5VkUmff5B8nNT4V/iYG270MrCCi/tsTg1rGWKiBrQ=
=qAMo
-----END PGP SIGNATURE-----


--
You received this message because you are subscribed to the Google Groups 
"google-guice" 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?hl=en.

Reply via email to