|Re: Future of DI Framework [message #893587 is a reply to message #893376]
||Wed, 04 July 2012 17:30
| Brian de Alwis
Registered: July 2009
I briefly investigated (out of curiosity) whether Guice could be used in place of our DI engine, and it didn't appear to be an easy switch -- Guice expects rather static modules, meaning that the contents of the modules do not change after being configured, whereas E4's contexts change frequently. Even if we did switch to Guice, or some other injector, we'd be under heavy pressure to ensure compatibility with the E4 annotations.|
The main annotations used for injection are standard (JSR 330), and supported by Spring, Guice, and others. So providing you restrict yourself to those, you can use your code interchangeably.
The main difference between the E4 injector and Guice, in terms of behaviour, is the use of the @Createable annotation to mark objects that can be auto created; Guice considers any object with a 0-art constructor to be auto-createable.
Hope that helps.
Powered by FUDForum
. Page generated in 0.01981 seconds