|
GuiceCompatibility
It looks like Guice, it walks like Guice, so it must be Guice?
Guice CompatibilityAPIWe have alternative types for:
For Module and AbtractModule, use GinModule and AbstractGinModule. They work much like their counterparts, but lack some of the features. Note that there is a 100% one-way conversion from GWT to Guice using GinModuleAdapter, so consider putting shared code in a GinModule. Other than that, you could also copy paste bindings from existing modules (usually they'll work), but of course copy-pasting should be discouraged. For Injector, use the Ginjector conbined with the @GinModules annotation. See the GinTutorial to learn how you can get started and GinFaq for more helpful hints. For everything else, use the Guice types. Note that we don not support everything Guice does (and we never will), so keep in mind when you are developing with GIN. See the feature comparison below for more information. FeaturesHere we compare the current GIN trunk with Guice 1.0 and 2.0. The feature list is not complete, but should give you a rough idea about what works and what doesn't. A = Available N/A = Not Available (will probably never happen) P = Planned (possible) Configuration
Runtime
|
Sign in to add a comment
When's the official release? EVERYONE wants to start using this ASAP
Why not support toInstance() by having the runtime code set the instances up after creating the Ginjector. For example:
class MyModule? extends AbstractGinModue? { configure() {
} }interface MyGinjector? extends Ginjector {
}class MyEntryPoint? implements EntryPoint? { onModuleCreate() { MyGinjector? injector = GWT.create(MyGinjector?); injector.setFooInstance(foo); injector.setBarInstance(bar); } }
You'd have to throw an error if an instance was not set before it was injected, but this approach seems quite straightforward to implement to me...
@thebravedave
We've been using it off of trunk for many months now. It works great.
Just a note for those trying to compile the Gin.jar from the trunk. It DOES work, you just have to make sure everything is configured correctly. Im a newbie, and just managed it myself.