views:

182

answers:

2

Some dependency injection containers enable you to inject configured services into an already constructed object.

Can this be achieved using Windsor, whilst taking account of any service dependencies there may be on the target object?

+3  A: 

No, it can't.

Krzysztof Koźmic
A: 

As Krzysztof said, there is no official solution for this. You might want to try this workaround though.

Personally, I consider having to do this a code smell. If it's your code, why isn't it registered in the container? If it isn't your code, write a factory/adapter/etc for it.

Mauricio Scheffer
I agree - it's a smell. Why do you want to do it in the first place? It's plain wrong.
Krzysztof Koźmic