
Originally Posted by
Rod Johnson
We could support this style of DI very easily as an additional option (and may well do), but as Spring already does a lot more wrt IoC I'm not convinced that it would provide a lot of value.
I would very much enjoy having the option of doing something like:
Code:
@inject MyService _myService;
instead of:
Code:
private MyService _myService;
public void setMyService( MyService myService )
{
// This public method exists for no other purpose than to hook into Spring
_myService = myService;
}
Although a little more controversial, I would even like an optional annotation that specifies an autowiring strategy. In simple scenarios, this could completely replace the declaration in applicationContext.xml