by using the terms “product” and “creator” can any one give me very brief overview of the factory method design pattern.
class PizzaMaker{
Pizza makePizza(String type){
if(type.equals(“cheese”)){
return new CheesePizza();
}
else if (type.equals(“veggie”)){
return new VeggiePizza();
}
}
}
Aucun commentaire:
Enregistrer un commentaire