|
|
|
|
|
by 9dev
1255 days ago
|
|
Until you want to add an argument to that constructor and find yourself modifying lots of files just to update that call everywhere. Or need a value from the application config, and have to patch the configuration instance through, several levels of classes deep. After wasting a day or two with those shenanigans, you’ll gladly take the DI framework, which makes both scenarios a single-line, 10 second change. |
|
The one that doesn't does whatever magic you were planning for the DI, does that, then calls the constructor with the arg.