Google leads to mostly muddled descriptions of “dependency injection”. I take it to mean that the creator of an object endows that object with the tools it needs. This is in contrast to the object as it begins life going out and fetching its tools via “ambient authority”. I presume that this latter pattern is seen as superior as the ambient authority will presumably acquire more modern versions which have been improved.

Here is an extreme edge case. I move a numeric algorithm, written in machine language to a new x86 CPU with the divide bug fixed. I grant that this is almost always an improvement, but not always. I may be contractually required to produce the same erroneous results as before. Don’t get me wrong; Intel did the right thing when they stopped producing chips with the bug.

When you call on a sort routine it probably wants a function to compare two records for ordering. It might also want a function successive calls to which provide the records to be sorted, and another function that takes sorted records in sort order for final disposal. Are these dependencies? I think there are no crisp answers to this muddled question.

Still my bias is not to change out the fundaments upon which your service relies without the consideration of those who created the service. Sometimes the creators are not available and then there is a dilemma.