public static void Main() { // We can choose concrete constructor (director) IVehicleConstructor constructor = new VehicleConstructor(); // And we can choose concrete builder VehicleBuilder builder = new ScooterBuilder(); constructor.Construct(builder); builder.Vehicle.Show(); builder = new CarBuilder(); constructor.Construct(builder); builder.Vehicle.Show(); builder = new MotorCycleBuilder(); constructor.Construct(builder); builder.Vehicle.Show(); }
public static void SecondDemo() { VehicleConstructor constructor = new VehicleConstructor(); // And we can choose concrete builder VehicleBuilder builder = new ScooterBuilder(); constructor.Construct(builder); builder.Vehicle.Show(); builder = new CarBuilder(); constructor.Construct(builder); builder.Vehicle.Show(); builder = new MotorCycleBuilder(); constructor.Construct(builder); builder.Vehicle.Show(); }
public static void Main() { VehicleBuilder builder; // We can choose concrete constructor (director) var constructor = new VehicleConstructor(); // And we can choose concrete builder builder = new ScooterBuilder(); constructor.Construct(builder); builder.Vehicle.Show(); builder = new CarBuilder(); constructor.Construct(builder); builder.Vehicle.Show(); builder = new MotorCycleBuilder(); constructor.Construct(builder); builder.Vehicle.Show(); }
static void Main(string[] args) { //We cabn choose concrete constructor (director) IVehicleConstructor director = new VehicleConstructor(); //And we can choose concrete builder VehicleBuilder builder = new CarBuilder(); director.Construct(builder); builder.Vehicle.Show(); director = new VehicleConstructor(); builder = new ScooterBuilder(); director.Construct(builder); builder.Vehicle.Show(); director = new VehicleConstructor(); builder = new MotorCycleBuilder(); director.Construct(builder); builder.Vehicle.Show(); }