Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            var maker = new VehicleMaker();

            maker.Builder = new CarBuilder();
            maker.Construct();
            maker.Builder = new BicycleBuilder();
            maker.Construct();
        }
Ejemplo n.º 2
0
        public static void Main()
        {
            VehicleMaker vehicleMaker1 = new VehicleMaker(new MotorCycleBuilder());

            vehicleMaker1.BuildVehicle();
            IVehicle vehicle1 = vehicleMaker1.GetVehicle();

            Console.WriteLine(vehicle1.GetFeatures());

            VehicleMaker vehicleMaker2 = new VehicleMaker(new CarBuilder());

            vehicleMaker2.BuildVehicle();
            IVehicle vehicle2 = vehicleMaker2.GetVehicle();

            Console.WriteLine(vehicle2.GetFeatures());
        }