Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 7
    I think you answered your own question, dependency injection is the standard way of solving this problem. Perhaps you should look into ways you can integrate dependency injection into your application? Commented May 17, 2018 at 12:30
  • Why would you not use dependency injection ? Using setters for needed dependencies is too implicit and fragile. Commented May 17, 2018 at 13:33
  • 1
    You probably think you're not using DI because you're not using a DI container, but what you're doing is still DI, even without the container. Commented May 17, 2018 at 15:17