Cliff Choongo
Cliff Choongo
CC#
Created by reeeeeee on 10/18/2024 in #help
When to use Dependency injection?
To understand whether you should use DI (Dependency Injection) or not you should first ask yourself and understand these three questions.What is DI? What is it used for? And what it's purpose or role? And then you will have a clear mind whether to use it not.DI makes your code to be more testable and maintainable.DI also has other benefits like it enables you to create an instance of an interface and that also applies to classes.
5 replies