示例#1
0
        static void Main(string[] args)
        {
            AbstractFactory carFactory = new CarFactory();
            AbstractCar     car        = carFactory.CreateProduct();

            car.Run();

            AbstractFactory busFactory = new BusFactory();
            AbstractCar     bus        = busFactory.CreateProduct();

            bus.Run();

            Console.Read();
        }
示例#2
0
 public Client(CarFactory car_factory)
 {
     abstractCar    = car_factory.CreateCar();
     abstractEngine = car_factory.CreateEngine();
     abstractBody   = car_factory.CreateBody();
 }
示例#3
0
 public Customer(Abstractions.AbstractFactory factory, Models model)
 {
     factory.Model = model;
     car           = factory.GetCar();
 }
示例#4
0
 public Client(CarFactory car_factory)
 {
     abstractCar    = car_factory.CreateCar();
     abstractEngine = car_factory.CreateEngine();
     abstractshape  = car_factory.CreateShape();
 }
示例#5
0
 public Client(CarFactory car_factory)
 {
     abstractCar    = car_factory.CreateCar();
     abstractEngine = car_factory.CreateEngine();
     abstractkuzov  = car_factory.CreateKuzov();
 }