static void Main(string[] args) { ICarFactory carFactory = new ToyotaFactory(); Car myCar = carFactory.CreateCar(); myCar.Info(); Engine myEngine = carFactory.CreateEngine(); myEngine.GetPower(); Wheels myWheels = carFactory.CreateWheels(); myWheels.GetDiametr(); carFactory = new FordFactory(); myCar = carFactory.CreateCar(); myCar.Info(); myEngine = carFactory.CreateEngine(); myEngine.GetPower(); myWheels = carFactory.CreateWheels(); myWheels.GetDiametr(); carFactory = new MersedesFactory(); myCar = carFactory.CreateCar(); myCar.Info(); myEngine = carFactory.CreateEngine(); myEngine.GetPower(); myWheels = carFactory.CreateWheels(); myWheels.GetDiametr(); Console.ReadKey(); }
static void Main(string[] args) { ICarFactory carFactory = new ToyotaFactory(); ClientFactory client1 = new ClientFactory(carFactory); client1.Run(); carFactory = new FordFactory(); ClientFactory client2 = new ClientFactory(carFactory); client2.Run(); Console.ReadKey(); }
static void Main(string[] args) { ICarFactory carFactory = new ToyotaFactory(); Car myCar = carFactory.CreateCar(); myCar.Info(); Engine myEngine = carFactory.CreateEngine(); myEngine.GetPower(); carFactory = new FordFactory(); myCar = carFactory.CreateCar(); myCar.Info(); myEngine = carFactory.CreateEngine(); myEngine.GetPower(); Console.ReadKey(); }
static void Main(string[] args) { ICarFactory carFactory = new ToyotaFactory(); ClientFactory client1 = new ClientFactory(carFactory); client1.Run(); carFactory = new FordFactory(); ClientFactory client2 = new ClientFactory(carFactory); client2.Run(); Console.WriteLine(""); carFactory = new MercedesFactory(); ClientFactory client3 = new ClientFactory(carFactory); client3.Run(); Console.WriteLine(""); Console.ReadKey(); }
public ToyotaAssemblyLine(ToyotaFactory factory) { _factory = factory; }