3 ms·
You don't have to write interfaces to have dependency injection. You can and should declare all your dependencies as constructor parameters. If you create them
by ivanche 6y ago
You don't have to write interfaces to have dependency injection. You can and should declare all your dependencies as constructor parameters. If you create them inside a class you'll permanently lock the two together, thus making it a testability nightmare.