Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            // Choose concrete constructor (director)
            CakeConstructor constructor = new CakeConstructor();

            // Choose concrete builder
            CakeBuilder builder = new BirthdayCakeBuilder();
            constructor.Construct(builder);
            builder.Cake.Show();

            builder = new CheeseCakeBuilder();
            constructor.Construct(builder);
            builder.Cake.Show();

            builder = new CupCakeBuilder();
            constructor.Construct(builder);
            builder.Cake.Show();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            // Choose concrete constructor (director)
            CakeConstructor constructor = new CakeConstructor();

            // Choose concrete builder
            CakeBuilder builder = new BirthdayCakeBuilder();

            constructor.Construct(builder);
            builder.Cake.Show();

            builder = new CheeseCakeBuilder();
            constructor.Construct(builder);
            builder.Cake.Show();

            builder = new CupCakeBuilder();
            constructor.Construct(builder);
            builder.Cake.Show();
        }