Exemple #1
0
            // Builder uses a complex series of steps

            public void Construct(VehicleBuilder vehicleBuilder)
            {
                vehicleBuilder.BuildFrame();
                vehicleBuilder.BuildEngine();
                vehicleBuilder.BuildWheels();
                vehicleBuilder.BuildDoors();
            }
Exemple #2
0
        public static void Execute()
        {
            VehicleBuilder builder1 = new VehicleBuilder();

            builder1
            .SetSeats(2)
            .SetDoors(2)
            .SetEnginePower(25)
            .SetWheels(4);

            ManufacturingInfoBuilder builder2 = new ManufacturingInfoBuilder(builder1.Buiild());

            builder2
            .SetManufacturer("Altkom")
            .SetDateTime(DateTime.Now);

            var builder = new VehicleBuilderFacade();

            builder
            .Components
            .SetSeats(2)
            .SetDoors(2)
            .SetEnginePower(25)
            .SetWheels(4)
            .Manufacturing
            .SetManufacturer("Altkom")
            .SetDateTime(DateTime.Now);

            var vehicle = builder2.Buiild();

            Console.WriteLine(vehicle);
        }
 // Builder uses a complex series of steps
 public void Construct(VehicleBuilder vehicleBuilder)
 {
     vehicleBuilder.BuildFrame();
       vehicleBuilder.BuildEngine();
       vehicleBuilder.BuildWheels();
       vehicleBuilder.BuildDoors();
 }