3 ms·
All of these articles omit just about the most important part of DI. And I admit it can be subtle, but the biggest thing DI solves is just initialization order.
by stefan_ 5y ago
All of these articles omit just about the most important part of DI. And I admit it can be subtle, but the biggest thing DI solves is just initialization order.
You can call it "Static Initialization Order Fiasco" in C++ or just general dependency handling, but a big problem in any sort of bigger server or framework is just setting up all the parts that make it run. If your handler A depends on B and C which in turn depend on D, E and F each of which can have their own dependencies, writing and maintaining the correct boilerplate that sets them up along the critical path is a problem best left for the fricking computer to figure out itself.