IoC.Resolve vs Constructor Injection
Posted
by Omu
on Stack Overflow
See other posts from Stack Overflow
or by Omu
Published on 2010-02-01T13:12:09Z
Indexed on
2010/05/19
9:10 UTC
Read the original article
Hit count: 222
I heard a lot of people saying that it is a bad practice to use IoC.Resolve(), but I never heard a good reason why (if it's all about testing than you can just mock the container, and you're done).
now the advantages of using Resolve instead of Constructor Injection is that you don't need to create classes that have 5 parameters in the constructor, and whenever you are going to create a instance of that class you're not gonna need to provide it with anything
© Stack Overflow or respective owner