Constructor, Method Call, and Property injection.

Mar 18, 2008 at 3:07 PM
I've gone through the docs on DependencyAttribute, InjectionMethodAttribute, and InjectionConstructorAttribute. I like the ability to have the container deal with injection of dependencies; and use of attributes is one way of accomplishing that.

But, this tightly couples the classes with injection dependencies to Unity. Is there not some way to do this without attributes, as well? e.g. through app.config or web.config?

There's a couple of scenarios where this becomes useful: 1) when I want POCO, 2) when I want these objects to be used in more than one IoC container, and 3) when I have no control over the source of the classes with injection dependencies.
Mar 18, 2008 at 3:17 PM
I talked about this in my Unity Screencast

The March 12th release has an injection api that allows you to specify dependencies without using dependency attributes. See the wiki. I would assume we will be able to do this in the config file, but I don't know for sure.

Best Regards,

Dave
Mar 18, 2008 at 3:45 PM
Thanks David, I guess I should have watched the screencast :-).

That's good news, there doesn't seem to be any mention of it in the March 12 chm; but the wiki link will suffice for now, thanks.
Mar 18, 2008 at 6:05 PM
That API was released on the 12th, it was finished on the 11th, the writer started somewhere around the 14th. ;-)
Mar 18, 2008 at 10:11 PM


ctavares wrote:
That API was released on the 12th, it was finished on the 11th, the writer started somewhere around the 14th. ;-)



Fair enough. Looking forward to the new drop...

Thanks