Example #1
0
        static void Main(string[] args)
        {
            //get shape factory
            AbstractFactory shapeFactory = FactoryProducer.getFactory("Shape");
            //get an object of Shape Circle
            IShape shape1 = shapeFactory.getShape("Circle");

            shape1.draw();

            //get shape factory
            AbstractFactory colorFactory = FactoryProducer.getFactory("Color");
            //get an object of Color Red
            IColor color1 = colorFactory.getColor("Red");

            color1.fill();

            Console.ReadKey();
        }