aspakh / google-gin

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

Support for custom scopes #114

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi all,

In the compatibility page, this Custom Scopes appears as P(?). Is there any 
real intention of implement this feature? Why it's marked with "(?)"? Is there 
any incompatibility or technical problem to make it works in GWT?

Thanks

Original issue reported on code.google.com by luisma...@gmail.com on 29 Jul 2010 at 12:21

GoogleCodeExporter commented 8 years ago
It would be really helpful to be able to inject scoped EventBus in huge app 
instead of having one app-wide bus.

Original comment by behag...@gmail.com on 15 Sep 2010 at 2:00

GoogleCodeExporter commented 8 years ago
Hi behaghel, probably you could inject different EventBus using @Name or custom 
annotations.

Original comment by luisma...@gmail.com on 16 Sep 2010 at 12:22

GoogleCodeExporter commented 8 years ago
Hi luis,
It sounds fair but in my case, the GWT app is composed of thousands of screens 
which are like miniapp with many transitions between them. This would imply 
thousands of @Name. Because a sub component may need the bus, every component 
should have a ref on it. With scope, I would simply create a scope for each 
screen, attach an instance of bus into it and use injection in components that 
require it.

Original comment by behag...@gmail.com on 16 Sep 2010 at 5:38

GoogleCodeExporter commented 8 years ago
Scopes are definitely an area where Gin could use improvement, the current 
support is very rudimentary. We'll look into this eventually although for now 
there is a number of other changes that are being worked on first.

Original comment by aragos on 21 Jan 2011 at 9:26

GoogleCodeExporter commented 8 years ago
That's a real pity :'(

Original comment by luisma...@gmail.com on 23 Jan 2011 at 10:22

GoogleCodeExporter commented 8 years ago
Strange that this does not get higher priority. GIN as it is is quite limited 
to simplistic applications that just want to avoid some globals.

I need to be able to define scopes per widget instance or per request (spanning 
multiple async calls) or per "render" loop in my widget that uses an 
incremental rendering technique (or per message queue, but now I am getting to 
detailed about my application needs).

It would already be nice if GIN would support the Scoping APIs of Guice, but it 
does not need to provide extra scopes besides no_scope and singleton. That is 
something I could implement in my application code.

Any ideas ?

Original comment by david.nouls on 4 Jan 2012 at 8:32