Lessons From "Dependency Injection Principles, Practices, and Patterns"
dev.to·12h·
Discuss: DEV
🔧Code Refactoring Patterns
Preview
Report Post

Book review of "Dependency Injection Principles, Practices, and Patterns" and lessons I learned from reading it.


Introduction

My first job as a software developer was writing C# for a software development agency that worked very closely with Microsoft. As a junior engineer, I had a basic notion of object-oriented programming and SOLID principles, but I was puzzled every time I opened a project that used .NET dependency injector container. Why are we writing an interface for everything? Why aren’t we instantiating instances inside of classes? Why are we passing all instances through the constructor? It all seemed very bureaucratic. I didn’t understand why we were following these strict ru…

Similar Posts

Loading similar posts...