bryan
bryan

Reputation: 190

What is the best approach to getting started with IoC in .NET

I've been reading up on IoC which seems to be a very broad and vague guideline. I have also been tasked with refactoring an enterprise system to make it more maintainable and testable. IoC promises to help me with these two aspects of the system.

What is the best approach to start using an IoC pattern? Should I focus on something more specific like dependency injection or should I try to rather wrap my head around the broader aspects of IoC?

I am very new to this and feel that I'm in in way over my head. Any advice would be appreciated.

Upvotes: 0

Views: 159

Answers (2)

Steven
Steven

Reputation: 172646

There's only one possible answer to this question :-). Read this book:

Dependency Injection in .NET by Mark Seemann

Upvotes: 3

jgauffin
jgauffin

Reputation: 101150

I would have said start with dependency injection. But without a container you'll end up doing a lot of work which have to be refactored again.

So I would start by learning how to use a container in a small test project and make sure that I understand the different lifetime scopes before continuing.

You could also read my IoC article: http://www.codeproject.com/Articles/386164/Get-injected-into-the-world-of-inverted-dependenci

Upvotes: 1

Related Questions