예제 #1
0
        static void Main(string[] args)
        {
            ComputerBuilder computerBuilder = new LaptopBuilder();
            Director        laptopDirector  = new LaptopDirector();

            laptopDirector.build(computerBuilder);
            Console.ReadKey();
        }
예제 #2
0
        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();
        }