Why not use Google GIN for your dependency injection needs:
http://code.google.com/p/google-gin/. It's a Guice implementation on
the client side. We're using it on a large project and it's working
out really well.

You can also use GWTMockUtilities.disarm(); to mock out GWT widgets.

--
Arthur Kalmenson



On Fri, Apr 10, 2009 at 11:52 AM, Yves <[email protected]> wrote:
>
> Hello
>
> Reading the documentation for the module xml files, i just realize
> that the tag <replace-with .../> allows for dependency injection.
>
> Suppose i need to use different class implementation depending on my
> environment (real class for production, mock for development ...). I
> just have to have two (or more) module xml like this
>
> For production use file FooProd.gwt.xml
>
> <module>
>  <replace-with class="foo.FooProdImpl">
>    <when-type-is class="foo.Foo" />
>  </replace-with>
>  ...
>
> For development use file FooDev.gwt.xml
>
> <module>
>  <replace-with class="foo.FooMockImpl">
>    <when-type-is class="foo.Foo" />
>  </replace-with>
>  ...
>
> Am i wrong?
>
> Regards
>
> >
>

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

Reply via email to