8. Builder
Separating the sequence of construction steps from the thing being constructed
PizzaOrder takes an order and produces the customer’s slip. The tests pass.
It writes that slip itself, so the wording and the order are welded together. The Recipe it was handed — which can be told size, base and topping one step at a time — is never used.
Rewrite place() to issue the steps to recipe and return recipe.result(). Issue them in this order: size, then base, then each topping in the order it was added. The sequence is your job; what is made of it is not.
Run compiles every file and runs Tests.java — the tests you can read.
Submit runs those again, then applies 1 requirement you have not seen, one at a time.
Your code is never edited. Each requirement is added to the project as it stands. If the design is right, nothing you wrote has to change.
- Ctrl/⌘ + Enter runs the tests
Run the tests to see where you are.