Dependency Injection (DI) is one of those things developers either love or hate. The love comes from how it helps decouple components cleanly. The hate? That’s often about the obscurity it can introduce, and the monstrosity of the setup code required by some DI containers.
In the .NET world, when teams decide to use a DI framework, they often start creating interfaces for every class—just to mock them in tests. I see this especially with less experienced developers who’ve been taught to unit test every class and method in isolation, leading to a flood of tiny classes and tests with questionable value.
What many developers don’t realize is that most DI frameworks (a.k.a. Inversion of Control containers) support injecting concrete classes. You don’t need interfaces just for the sake of DI. In fact, you might not even need DI at all—unless your system is growing to a size where it makes sense.
If you do use DI, think carefully about internal boundaries, bounded contexts, functional slices—whatever internal seams your architecture has. You usually only need DI across those boundaries, where mocking makes sense. Inside those boundaries, it’s often unnecessary.
And if you do need DI inside a boundary, create a class within that slice (usually a functionally named folder) and keep the DI registration code local to it. Keep it tidy.
#dependencyinjection#inversionofcontrol#unittesting#mocking#lessonslearned#consultancy#avivasolutions
How to write testable code that requires you to reshape your application sensibly to make it testable.
#InversionOfControl#DependencyInjection (passing dependencies into your functions/objects) is a favorite paradigm now.
View of social media future: your tweets/posts live in your physical custody and you “license” your content for distribution on different social media networks.
#inversionofcontrol
Also, I need to "relearn" Linux. It's been a decade or so since I used it to build a virtual #Oracle server & I was never an expert with #Linux or #Java
Microsoft DOT Net #C#SQL#XML#Javascript were some of my areas of expertise.
Oh and #InversionOfControl (love reflection)
Optimally, Pull and Push must be bidirectional.
Example: CF teams must offer "a menu of ways " external specialists can "meddle" with their work. That way specialists can "Pull" CF teams into "alignment" or "compliance".
This is just #InversionOfControl at another level.