Inversion of Control (IoC)
References:
Inversion of Control (also referred to as Dependency Inversion or Dependency Injection) is depending on interfaces rather than concrete classes, so that the implementation of interfaces can be swapped out at compile time (e.g., for testing), but the control flow is the same at runtime.
Here's an example without IoC
And here's an example with IoC