How to Refactor a Dependency Injection Program

Asked

Viewed 55 times

0

Could someone explain me what the Dependency Injection Pattern is and how to refactor the following code?

public class Motor{
   ICombustivel combustível;

   public Motor(){
     combustível = new Gasolina();
   }
}
  • 2
  • 1

    Related: http://answall.com/q/21319/101.E http://answall.com/q/40806/101. With these I think the question may be duplicated.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.