Beispiel #1
0
        static void Main(string[] args)
        {
            Director director = new Director();
            Builder builder1 = new ConcreateBuilder1();
            Builder builder2 = new ConcreateBuilder2();

            director.Construct(builder1);
            Product product1 = builder1.GetProduct();
            product1.Show();

            director.Construct(builder2);
            Product product2 = builder2.GetProduct();
            product2.Show();

            Console.ReadKey();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Director director = new Director();
            Builder b1 = new ConcreteBuilder1();
            Builder b2 = new ConcreteBuilder2();

            director.Construct(b1);
            Product p1 = b1.GetResult();
            p1.Show();

            director.Construct(b2);
            Product p2 = b2.GetResult();
            p2.Show();

            Console.Read();
        }