Exemplo n.º 1
0
        public static void Ex_B1_BasicStructure()
        {
            Console.WriteLine("Start of Ex_B1_BasicStructure");
            B1_BasicStructure.Builder builder = new ConcreteBuilder1();
            Director director = new Director(builder);

            director.Construct();

            Product product = builder.GetResult();

            product.Show();
            Console.WriteLine("End of Ex_B1_BasicStructure");
        }
Exemplo n.º 2
0
        /// <summary>
        /// Entry point into console application.
        /// </summary>
        public void Run()
        {
            // Create director and builders
            var director = new Director();

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

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

            p1.Show();

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

            p2.Show();
        }