Пример #1
0
        static void Main(string[] args)
        {
            VehicalBuilder builder;
            ShopVehicle    shopVehicle = new ShopVehicle();

            builder = new MotorCycleBuilder();
            shopVehicle.ConstructParts(builder);
            builder.productVehicle.ShowDetails();

            builder = new CarBuilder();
            shopVehicle.ConstructParts(builder);
            builder.productVehicle.ShowDetails();

            builder = new TruckBuilder();
            shopVehicle.ConstructParts(builder);
            builder.productVehicle.ShowDetails();

            Console.ReadLine();
        }
Пример #2
0
        static void Main(string[] args)
        {
            CarShop carshop = new CarShop();
            CarBuilder carbuilder;

            carbuilder = new ConvertibleBuilder();
            carshop.BuildCar(carbuilder);
            carbuilder.Car.DisplayCar();

            carbuilder = new CoupeBuilder();
            carshop.BuildCar(carbuilder);
            carbuilder.Car.DisplayCar();

            carbuilder = new SedanBuilder();
            carshop.BuildCar(carbuilder);
            carbuilder.Car.DisplayCar();

            carbuilder = new SUVBuilder();
            carshop.BuildCar(carbuilder);
            carbuilder.Car.DisplayCar();

            carbuilder = new TruckBuilder();
            carshop.BuildCar(carbuilder);
            carbuilder.Car.DisplayCar();

            Console.ReadKey();
        }