As I understand Factory Method is Simple Factory and Factory Object is Abstract Factory? And:
-Factory Method (Simple Factory):
public class SimplePizzaFactory {
public static final int CHEESE = 1;
public static final int PEPPERONI = 2;
public static final int VEGGIE = 3;
public static Pizza createPizza(int type) {
Pizza pizza = null;
if (type == CHEESE) {
pizza = new CheesePizza();
} else if (type == PEPPERONI ) {
pizza = new PepperoniPizza();
} else if (type == VEGGIE ) {
pizza = new VeggiePizza();
}
return pizza;
}
}
Factory Object(Abstract Factory):
?
Am I right?
How much are there realizations of Factory patterns and what is their difference?