Closed GoogleCodeExporter closed 9 years ago
This issue is a enhancement, not a defect. And I forgot to say that the source
code is
fully included in the jar.
Original comment by lucas.eustaquio@gmail.com
on 23 Mar 2010 at 5:01
Hi Lucas, thanks for your interest in contributing to Gin!
The reason why we didn't implement Gin in this way (which is really the same as
guice) is that it creates a huge overhead in code size: code needs to be
generated
for *all* injectable types instead of just the ones that are used by the final
code.
Since GWT is a lot about optimizing the compiled code, this is not an option.
Original comment by aragos
on 23 Mar 2010 at 8:53
Would it be possible to get the best of both worlds by using an annotation on
the
types that should be available from the injector? I find it somewhat of a
burden to
add a method in the injector for each of my injectable types.
I didn't do this before, since I didn't have much need to use the injector
directly
(constructor injection and method injection were OK), but since I've started
writing
my own generator, I found it necessary to manually inject types through the
injector.
(This is discussed here: http://groups.google.com/group/google-web-
toolkit/browse_frm/thread/acde3be9181d1803) And now I have to maintain the
injector
in parallel with my injectable types.
Original comment by philippe.beaudoin
on 25 Mar 2010 at 5:37
If you want it, you can take the attached jar and make this modification
yourself. you
just need to change the method GinjectorExtUtils.getInjectableTypes. Then you
should
call DefaultInjector.inject in your generated code, therefore eliminating the
need of
maintaining your parallel injector.
Original comment by lucas.eustaquio@gmail.com
on 25 Mar 2010 at 8:20
I gave a thought about aragos commentary, and I a believe that is way to do
some
workaround about the code overhead. It could load asynchronously the injection
code
when it is needed based in the injected type dependecy tree.
Original comment by lucas.eustaquio@gmail.com
on 25 Mar 2010 at 8:30
Original issue reported on code.google.com by
lucas.eustaquio@gmail.com
on 23 Mar 2010 at 4:49Attachments: