Our Coding Dojo uses Pancake Lab, a pancake shop software solution for ordering pancakes. The software solution can be used to order pancakes to the disciples' rooms and also by the Sensei's Chef and Delivery service to prepare and deliver the pancakes.
- In the first step the Disciple creates an Order and specifies the building and the room number.
- After that the Disciple can add pancakes from the menu.
- The Disciple can choose to complete or cancel the Order, if cancelled the Order is removed from the database.
- If the Disciple completes the Order the Chef can prepare the pancakes.
- After the Chef prepares the Order it can be delivered.
- After the Order is sent for delivery it is removed from the database.
At first all was well but soon Disciples started to demand various kinds of pancakes that the application didn't support or anyone could ever imagine. The evil Dr. Fu Man Chu, the main Villain fighting the Sensei in an endless confrontation, took the chance to bring havoc against his hated Dojo. He hacked the system to add mustard with milk-chocolate and whipped cream pancake. Some errors were also reported, disciples reported that pancakes were missing, delivery reported that they were sent to a building that does not exist, etc.
The Sensei proposed that the application should be refactored. You, his best Disciple, have been tasked to save the pancakes production in the Dojo.
The Sensei has put forth some conditions:
- the solution should be based on Object-oriented programming
- TDD should be followed
- the solution and the client API should be based on pure Java only, without usage of any frameworks and/or external dependencies
- the API should not expose any internal domain objects to its callers
- the solution should avoid hardcoded recipes
- disciples should not use builders to create pancakes and pass them to the API, they should be able to add ingredient after ingredient to the pancake through the API
- input data should be validated
- possible data-race issues should also be addressed
- documentation in the form of UML diagrams would be beneficial
Start now your assignment and save the Dojo.