Exemplo n.º 1
0
        private static void BuilderPatternDemo()
        {
            AbstractWidget abstractWidget = new SmallWidget(FinishColor.PlatedPlatinum);
            WagBuilder     wagBuilder     = new WidgetBuilder(abstractWidget);
            WagDirector    wagDirector    = new WidgetDirector();
            IWag           widget         = wagDirector.Build(wagBuilder);

            Console.WriteLine(widget);

            AbstractGadget abstractGadget = new SmallGadget(FinishColor.PlainBlack);
            WagBuilder     builder        = new GadgetBuilder(abstractGadget);
            WagDirector    director       = new GadgetDirector();
            IWag           gadget         = director.Build(builder);

            Console.WriteLine(gadget);
        }