Content deleted Content added
FluffySquid (talk | contribs) →Is this the best way of doing this?: new section |
FluffySquid (talk | contribs) |
||
Line 110:
public class BuilderExample {
Cook cook = new Cook();
PizzaBuilder hawaiianPizzaBuilder = new HawaiianPizzaBuilder();
PizzaBuilder spicyPizzaBuilder = new SpicyPizzaBuilder();
cook.setPizzaBuilder(hawaiianPizzaBuilder);▼
cook.constructPizza();▼
▲ cook.setPizzaBuilder(hawaiianPizzaBuilder);
▲ cook.constructPizza();
cook.setPizzaBuilder(spicyPizzaBuilder);▼
Pizza spicy = cook.getPizza();
▲ cook.setPizzaBuilder(spicyPizzaBuilder);
}
▲ Pizza spicy = cook.getPizza();
}
Line 130:
public class BuilderExample {
Cook cook = new Cook();
PizzaBuilder hawaiianPizzaBuilder = new HawaiianPizzaBuilder();
PizzaBuilder spicyPizzaBuilder = new SpicyPizzaBuilder();
cook.constructPizza(hawaiianPizzaBuilder);
Pizza hawaiian = hawaiianPizzaBuilder.getPizza();
cook.constructPizza(spicyPizzaBuilder);
Pizza spicy = spicyPizzaBuilder.getPizza();
}
|