static void Main(string[] args) { ComputerBuilder computerBuilder = new LaptopBuilder(); Director laptopDirector = new LaptopDirector(); laptopDirector.build(computerBuilder); Console.ReadKey(); }
private static void Builder() { var computerShop = new ComputerShop(); ComputerBuilder computerBuilder; computerBuilder = new LaptopBuilder(); computerShop.ConstructComputer(computerBuilder); computerBuilder.Computer.DisplayConfiguration(); computerBuilder = new DesktopBuilder(); computerShop.ConstructComputer(computerBuilder); computerBuilder.Computer.DisplayConfiguration(); computerBuilder = new AppleBuilder(); computerShop.ConstructComputer(computerBuilder); computerBuilder.Computer.DisplayConfiguration(); Console.ReadKey(); }