package cn.datax.learning.design.patterns.creational.factory.simple;

import cn.datax.learning.design.patterns.creational.factory.Shape;

/**
 * 工厂模式（Factory Pattern）
 * 1.简单工厂模式又称静态工厂模式
 */
public class SimpleFactoryDemo {

    public static void main(String[] args) {
        ShapeFactory shapeFactory = new ShapeFactory();

        Shape shape1 = shapeFactory.getShape("CIRCLE");
        shape1.draw();

        Shape shape2 = shapeFactory.getShape("RECTANGLE");
        shape2.draw();

        Shape shape3 = shapeFactory.getShape("SQUARE");
        shape3.draw();
    }
}
