Example #1
0
    static void Main()
    {
        Maker[] Makers = new Maker[3];
        Makers[0] = new ConcreteMakerA();
        Makers[1] = new ConcreteMakerB();
        Makers[2] = new ConcreteMakerC();

        foreach (Maker Maker in Makers)
        {
            Product product = Maker.FactoryMethod();
            Console.WriteLine("Created {0}", product.GetType().Name);
        }
        Console.Read();
    }
Example #2
0
    static void Main()
    {
        Maker[] Makers = new Maker[3];
        Makers[0] = new ConcreteMakerA();
        Makers[1] = new ConcreteMakerB();
        Makers[2] = new ConcreteMakerC();

        foreach (Maker Maker in Makers)
        {
            Product product = Maker.FactoryMethod();
            Console.WriteLine("Created {0}", product.GetType().Name);
        }
        Console.Read();
    }