sgkhode / google-gin

Automatically exported from code.google.com/p/google-gin
Apache License 2.0
0 stars 0 forks source link

Deferred binding for @GinModules value #74

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'd like be able to run multiple configurations of GWT applications via 
Deferred Binding (with replacement)

What steps will reproduce the problem?
1. Define abstract GinModule and add it as module for Ginjector extending 
interface
2. Define property in GWT module, and rules for replacement of abstract 
GinModule for a concrete GinModule
3. Run GWT application with property set to value that would trigger 
GinModule replacement

What is the expected output? What do you see instead?

I'd like to have GIN Modules instantiated via Deferred Binding (in 
instantiateGModuleClass(Class<? extends GinModule>)).

instantiateGModuleClass(Class<? extends GinModule>) instantiates instead 
via constructor reflection.

What version of the product are you using? On what operating system?

GWT 2.0.0, GIN-1.0

Gin allows for little configuration right now, it's rather single 
configuration framework (GinModules are bound to Ginjectors). Such feature 
would increase its utilness.

Original issue reported on code.google.com by tomek.ma...@gmail.com on 18 Jan 2010 at 11:48

GoogleCodeExporter commented 8 years ago
Sorry, this should be Enhancement, i don't know how to change type.

Original comment by tomek.ma...@gmail.com on 18 Jan 2010 at 11:49

GoogleCodeExporter commented 8 years ago
I do not believe this is possible. The problem is that the Gin generation code 
runs
at compile-time and cannot itself rely on generated code.

There are a few further features in Gin that would greatly benefit from direct 
access
to GWT's deferred binding framework but I haven't at all looked at the 
feasability of
an API there and how much work it would be.

If you're willing to write your own generator, you can make it write out the 
correct
source for your gin module and then call GWT.create for the ginjector from some
generated code. That way you can actually let Gin use generated code.

I'll mark this Won't Fix for now since I don't see a way to fix this and there 
is a
(kind of) workaround. Feel free to comment if you think I should reopen the 
issue.

Original comment by aragos on 19 Jan 2010 at 11:03