2 ms·
Require is a service locator, so you are getting some of the inversion of control benefits, but I greatly prefer the injections of the dependencies I need inste
by joelhooks 13y ago
Require is a service locator, so you are getting some of the inversion of control benefits, but I greatly prefer the injections of the dependencies I need instead of relying on a locator.
In practice the DI approach is very nice, and works consistently. It also makes unit tests more straight forward.