Exemplo n.º 1
0
        static void Main(string[] args)
        {
            IFactory WoodenDoorFactory = new WoodenDoorFactory();
            IFactory IronDoorFactory   = new IronDoorFactory();

            IDoor WoodenDoor = WoodenDoorFactory.makeDoor();
            IDoor IronDoor   = IronDoorFactory.makeDoor();

            IExpert Carpenter = WoodenDoorFactory.makeExpert();
            IExpert Welder    = IronDoorFactory.makeExpert();

            WoodenDoor.getDescription();
            Carpenter.getDescription();

            IronDoor.getDescription();
            Welder.getDescription();

            System.Console.ReadLine();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            IDoorFactory woodenfactory = new WoodenDoorFactory();
            IDoorFactory ironfactory   = new IronDoorFactory();

            var woodendoor = woodenfactory.MakeDoor();
            var carpenter  = woodenfactory.GetExpert();

            var irondoor = ironfactory.MakeDoor();
            var welder   = ironfactory.GetExpert();

            woodendoor.GetDetails();
            carpenter.GetDetails();

            irondoor.GetDetails();
            welder.GetDetails();

            Console.ReadKey();
        }