public static Car GetACarFromFactory(Func <CarGas, Car> getARunningCarWithGas) { CarGas gas = GetSomeCarGas(); Car runningCar = getARunningCarWithGas(gas); // VendingMachine don't have the knowledge of Engine & Wheel. Only provide the Gas. MustDoCarTesting(runningCar); return(runningCar); }
public static Car GetACarFromFactory(CarEngine engine, CarWheel wheel) { CarGas gas = GetSomeCarGas(); Car runningCar = CarFactory.BuildARunningCar(engine, wheel, gas); // VendingMachine has the knowledge of Engine & Wheel at this point MustDoCarTesting(runningCar); return(runningCar); }
public static Car BuildARunningCar(CarEngine engine, CarWheel wheel, CarGas gas) { return(new Car()); }
public static Car BuildARunningCar(CarEngine engine, CarWheel wheel, CarGas gas) { return new Car(); }