Strategy pattern and Dependency Injection both allow us to set / inject objects at run time. What is the difference between Strategy pattern and Dependency Injection?
Dependency injection is a refinement of the strategy pattern which I will briefly explain. It is often necessary to choose between several alternative modules at runtime. These modules all implement a common interface so that they can be used interchangeably. The purpose of the strategy pattern is to remove the burden of deciding upon which of the modules to use (ie which "concrete strategy" or dependency) by encapsulating the decision-making process into a separate object which I will call the strategy object.
Dependency injection refines the strategy pattern by not only deciding which concrete strategy to use but creating an instance of the concrete strategy and "injecting" it back into the calling module. This is useful even if there is only a single dependency as the knowledge of how to manage (initialise etc) the concrete strategy instance can also be hidden within the strategy object.