fmgasparino / google-gin

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

RFE: provide GinModule for GWT 2.1 bindery (PlaceController, EventBus, PlaceHistoryHandler, etc.) #117

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
GWT 2.1 will provide a bunch of new classes that would greatly benefit from DI. 
Having a GinModule that you can install() or reference in your 
@GinModules/Ginjector would save us all defining the bindings and providers.
Such a module should at least provide:
 - bind(EventBus.class).to(SimpleEventBus.class).in(Singleton.class)
 - @Provides @Singleton PlaceController providePlaceController(EventBus bus)
 - @Provides ProxyPlace.Tokenizer
 - @Provides ProxyListPlace.Tokenizer

and possibly helper methods, such as:
 - bindRequestFactory(MyRequestFactory.class);
 - bindPlaceHistoryHandler(MyMapper.class);
 - bindPlaceHistoryHandler(MyMapper.class, MyFactory.class);
that would automatically call the .register() or .init() methods on the 
instantiated objects.

Original issue reported on code.google.com by t.broyer on 16 Sep 2010 at 10:05

GoogleCodeExporter commented 9 years ago
+1 as mentioned on GWT mailing lists ...
I better understand why you answered me so fast ;)

For the moment, this defect is the only bad point during my integration of GIN.

Original comment by biard.ro...@gmail.com on 21 Jan 2011 at 10:24

GoogleCodeExporter commented 9 years ago
Ok, I hope this is not seen as a defect but as a missing feature in Gin. :) 
Feel free to provide a codereview per our contributor process that adds such a 
module. I'm not sure if we should put the helper methods into the same module 
as the default bindings - you might want to use the helper methods without the 
defaults.

Original comment by aragos on 21 Jan 2011 at 11:43