Instance management with Dependency injection (DI)

Posted by Sven on Stack Overflow See other posts from Stack Overflow or by Sven
Published on 2010-04-22T13:31:56Z Indexed on 2010/04/22 13:33 UTC
Read the original article Hit count: 368

Filed under:
|
|

Hello

I'm trying to understand how DI exactly works. I'm currently using Windsor as DI container. I use this to load my services dynamically in code without direct reference. But I have change behaviour and want to know a bit more on the instance mgmt using DI.

I have a web app projct, here is a WCF service using PerCall as instancemode. This means, new instance/call. In this WCF I call a service (loaded via DI) and this service calls another service (again loaded via DI). The WCF is a new instance in the appdomain, but what about the services. They are also new instances? Is this DI container shared among all WCF instances and are the services in this container also single instances?

Can anyone clarify?

© Stack Overflow or respective owner

Related posts about dependency-injection

Related posts about di