3 ms·
Dependency Injection allows for more incremental development in my experience. As each new class is simply added to a constructor somewhere and the system take
by gitgud 3y ago
Dependency Injection allows for more incremental development in my experience. As each new class is simply added to a constructor somewhere and the system takes care of constructing things.
Regardless of what the article says, mocking in tests is easier. As you’re only depending on injected classes, you just mock a class and inject it in a test.
Like any architectural decision “it depends”. But I think it scales well, enforces modularity, automates construction logic (which can be huge) and is quite nice to work with generally.