Esempio n. 1
0
        static void Main(string[] args)
        {
            var director = new Director();

            var b1 = new ConcreteBuilder1();
            var b2 = new ConcreteBuilder2();

            director.Construct(b1);
            var p1 = b1.GetResult();

            p1.Show();

            director.Construct(b2);
            var p2 = b2.GetResult();

            p2.Show();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Director director = new Director();

            Builder b1 = new ConcreteBuilder1();
            Builder b2 = new ConcreteBuilder2();


            // Construct two products
            director.Construct(b1);
            Product p1 = b1.GetResult();

            p1.Show();

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

            p2.Show();

            // Wait for user
            Console.ReadKey();
        }