My favorites | Sign in
Project Logo
                
Search
for
Updated Oct 12, 2009 by ashmind
Labels: Featured
Autowiring  
Injection and autowiring features

Click the images to be able to follow links.

Notes

Autowiring is a name for framework-discovered injection points.

Open generics support is an ability to register open generic types and receive specific generic types on demand. Basically, it is about registering Component<> as IService<> (not giving any generic arguments), and on request of IService<X> getting Component<X>.

Service list support is an ability to register several IService implementations, and then get them all through IService (IList/IEnumerable/…) dependency.

Andrey Shchekin:

For multiple constructors, I really like the choice of constructor with most resolvable parameters. This is precisely what the human programmer will do, given a number of constructors and dependencies. With other approaches, it is harder to keep object DI-ignorant — you have to think whether your most-parameter constructor is resolvable, add DI-specific attributes or specify the constructor explicitly in the XML/code configuration.

Recursive dependency resolution is, in my opinion, one of the most important things in a DI framework. In a large project, when you have a lot of components and services, solving recursion easily is a must. While some frameworks produce a useful error message, other crash with unrecoverable StackOverflowException, which is a bad, bad thing to get in automatic test runner.

Sign in to add a comment
Hosted by Google Code