예제 #1
0
        static void Main(string[] args)
        {
            // The client code creates a builder object, passes it to the
            // director and then initiates the construction process. The end
            // result is retrieved from the builder object.
            var director = new Director();
            var builder  = new BuildMetro();

            director.Builder = builder;

            Console.WriteLine("Standard basic product:");
            director.buildMinimalViableProduct();
            Console.WriteLine(builder.GetProduct().ListParts());

            Console.WriteLine("Standard full featured product:");
            director.buildFullFeaturedProduct();
            Console.WriteLine(builder.GetProduct().ListParts());

            // Remember, the Builder pattern can be used without a Director
            // class.
            Console.WriteLine("Custom product:");
            builder.Weer();
            builder.Buitenlands();
            Console.Write(builder.GetProduct().ListParts());
        }
        static void Main(string[] args)
        {
            var director = new Director();
            var builder  = new BuildMetro();

            director.Builder = builder;

            Console.WriteLine("De Metro:");
            director.buildMetro();
            Console.WriteLine(builder.GetProduct().ListParts());

            Console.WriteLine("HLN:");
            director.buildFullFeaturedProduct();
            Console.WriteLine(builder.GetProduct().ListParts());
        }
예제 #3
0
        static void Main(string[] args)
        {
            // The client code creates a builder object, passes it to the
            // director and then initiates the construction process. The end
            // result is retrieved from the builder object.
            var director = new Director();
            var builder  = new BuildMetro();

            director.Builder = builder;

            Console.WriteLine("De Metro:");
            director.buildMetro();
            Console.WriteLine(builder.GetProduct().ListParts());

            Console.WriteLine("HLN:");
            director.buildFullFeaturedProduct();
            Console.WriteLine(builder.GetProduct().ListParts());
        }