2

Is there any reason why I can't just use Guice for DI inside a GWT application? If so, why? If not, what does GWT-GIN really offer that POG (plain ole' Guice) doesn't?

IAmYourFaja
  • 55,468
  • 181
  • 466
  • 756

1 Answers1

5

Guice depends pretty heavily on reflection, which isn't really fully supported in GWT.

Louis Wasserman
  • 191,574
  • 25
  • 345
  • 413
  • So what happens when I try to compile my Guice-injected GWT code into JavaScript? Does the compilation fail or does the generated code just not work? – IAmYourFaja Jul 06 '12 at 18:29
  • I believe the compilation should fail, but I'm not positive. As I understand it, GIN works out the injection details at compile time so GWT doesn't have to deal with the reflection. – Louis Wasserman Jul 06 '12 at 18:31