static void Main(string[] args) { //razdelqme na chasti syzdavaneto na edin obekt Console.WriteLine("Hello World!"); Car car = new Car(); CarBuilder builder = new CarBuilder(); //buildPattern builder.BuildEngine(car); builder.BuildKutiq(car); builder.BuildTyres(car); //fluent interface builder.BuildTyres(car) .BuildTyres(car) .BuildKutiq(car); }
public void Construct(CarBuilder builder) { builder.BuildBody(); builder.BuildEngine(); builder.BuildWheels(); }