Example #1
0
        static void Main(string[] args)
        {
            CarFactory   carFactory   = new CarFactory();
            ICarSupplier carSuppllier = carFactory.GetCar(CarFactory.CarType.Peugeot);

            carSuppllier.Start();

            carSuppllier = carFactory.GetCar(CarFactory.CarType.Benz);
            carSuppllier.Start();

            carSuppllier = carFactory.GetCar(CarFactory.CarType.Bmw);
            carSuppllier.Start();
        }
Example #2
0
        static void Main(string[] args)
        {
            CarFactory car = new CarFactory();
            ICar       c   = car.GetCar(CarFactory.carType.Fast);

            c.Run();
            Console.ReadLine();
        }
Example #3
0
 public void AssembleCar(CarFactory factory)
 {
     factory.GetCar();
 }