Closed GoogleCodeExporter closed 9 years ago
created branch factory_prototype for this.
see http://groups.google.com/group/morphia/browse_thread/thread/e2f643e668613526
Original comment by google-a...@codesmell.de
on 20 Mar 2011 at 8:54
committed a prototype, please verify the change.
We might want to changes some names, but basically, the idea is rerouting
newInstance to objenesis and provide a simple hook for DI to step in.
for instance a guice impl would be as easy as extending DefaultInstanceFactory,
trying a
injector.getInstance(clazz)
and, if that fails use onInstantiation to do
injector.injectMembers(instance)
so that injector-defined scope is adhered to, as well as dependencies are
injected.
Original comment by google-a...@codesmell.de
on 20 Mar 2011 at 10:49
Original issue reported on code.google.com by
google-a...@codesmell.de
on 20 Mar 2011 at 2:35