Reddit Reddit reviews Dependency Injection in .NET

We found 7 Reddit comments about Dependency Injection in .NET. Here are the top ones, ranked by their Reddit score.

Computers & Technology
Books
Microsoft Project Guides
Business Technology
Dependency Injection in .NET
Check price on Amazon

7 Reddit comments about Dependency Injection in .NET:

u/TheEternal21 · 16 pointsr/programming

TDD + Dependency Injection. Mastering those two concepts was critical in my career, and got me over the imposter syndrome in Senior Software Engineer position. I highly recommend the following book, it will completely change how you write modular code: https://www.amazon.com/Dependency-Injection-NET-Mark-Seemann/dp/1935182501

From someone's Amazon review, this is not an exaggeration:

> The Short Story: This is the best software development book I have ever read. By miles. Or, in deference to Mr. Seeman, in kilometers. Stop. Buy this book. It will change how you think, how you reason, how you sleep at night. See you in a year, we will both be smarter.

u/giulianob · 9 pointsr/PHP

Your example isn't dependency injection, it's service locator pattern which is different. Service locator IMO is a piece of crap, you can find a popular post against service locator here.

I built a large game backend at first without using proper DI. It really bit me in the ass because it made our code extremely difficult to test and keep decoupled as the app got larger. Definitely not all IoC containers are on par with each other and some of the IoC crowd goes a bit too far with patterns at times. However, without using DI your code will turn into a mess. You don't really need an IoC container for smaller projects but they should be relatively light weight and a good container is easy to use so I'd always recommend using one.

If you want a good book on the topic, check out Dependency Injection in .NET. Though not PHP specific, it does a great job at explaining how DI works and the core concepts apply to any language.

u/ThereKanBOnly1 · 7 pointsr/dotnet

I think you partially need to decide what area you want to focus on. Generally if you're going to delve into more advanced materials they should also be geared towards the in depth aspects of a specific technology, methodology, or problem.

I'll add a +1 for the design patterns suggestion. The Head First book is an option, but here is the book that I've got that is quite good. There's always the gang of 4 book, and although it is the "design patterns bible" its also a bit dry.

I'm also going to suggest Mark Seemann's Dependency Injection book. Although it is about DI and inversion of control containers, he also really focuses on SOLID design that makes DI more effective.

If you don't know what SOLID design principles are, then I'd brush up on that.

Turning specifically to C#, there's Jon Skeet's C# in Depth and also Jeremy Richter's CLR via C#. Both are great books are focused on roughly the same thing, understanding some of the inner workings of of the C# language, but they each approach it in a slightly different way. Although the CLR book came out before, C# in Depth seems to be a bit more highly regarded. I'd take a look at the TOC of each and see which one interests you more.

Outside of that, I'd say make sure that you really understand concepts like generics, reflection, and maybe even dive into understanding some MSIL.

u/LloydAtkinson · 6 pointsr/csharp

Disappointing no one else posted this yet but https://www.amazon.co.uk/Dependency-Injection-NET-Mark-Seemann/dp/1935182501 is literally THE book.

Have a browse of Mark's excellent blog too. If you DO use a container (you don't have to, you can manually compose the composition root yourself) you should also NOT use the service locator anti-pattern: http://blog.ploeh.dk/2010/08/30/Dontcallthecontainer;itllcallyou/

u/rmunn · 4 pointsr/fsharp

Considering that Mark Seemann literally wrote the book on dependency injection in .Net, it's theoretically possible that he does understand all its nuanced complexities, and that dismissing this presentation (which is, naturally, simplified so it makes a good presentation) as "populist nonsense" is a mite hasty.

u/concatenated_string · 2 pointsr/pics

I encourage you to read this book

this book really opened my eyes to a lot and it goes at it as if you had no idea about IoC containers and dependency injection. it really Is fantastic.

u/vipetrul · 1 pointr/csharp

There is a really good book about Dependency Injection in .NET

In regards how to use DI with NHibernate, there is a good article describing just that: Dependency Injection and Unit Of Work using Castle Windsor and NHibernate