100 likes | 285 Views
MTO Ordering System. Henry, Hayden, and Kellie. Purpose. Our project modeled an ordering system similar to Sheetz It allowed a user to order a variety of food and drinks by clicking buttons on a screen. Key Components. GUI – Hayden State, factory, and façade patterns Ordering – Kellie
E N D
MTO Ordering System Henry, Hayden, and Kellie
Purpose • Our project modeled an ordering system similar to Sheetz • It allowed a user to order a variety of food and drinks by clicking buttons on a screen
Key Components • GUI – Hayden • State, factory, and façade patterns • Ordering – Kellie • State, singleton, and observer patterns • Food Options – Henry • Strategy, decorator, and template patterns
Development Process • First we decided on a general UML and then assigned parts to each person so that each person had three patterns • Each person came up with their own UMLs for their patterns • We coded our own parts and resolved conflicts as we put it together
Ordering • Singleton pattern for the order so you can not have more than one order at a time • Observer pattern for the receipt printer so the order can notify the printer when a receipt needs to be printed • State pattern for the order so different actions can happen when it is in different states
State Pattern for Ordering • Three States: • Idle State • In the idle state, you can just begin the order and this takes you to the ordering state • Ordering State • In the ordering state, you can add items. • You can also cancel the order which brings you back to idle and complete the order which brings you to the complete state • Complete Order State • In the complete order state you can pay for the order or cancel your order, both bring you back to the idle state This pattern is completed in the code
Inventory • State pattern to keep track of availbility of product. • OutOfStockState would prevent the order from using the product if we ran out of that product.
User Interface • Façade pattern used to simplify the ordering process for the user. • Factory pattern used to create the screens as we needed for the menu system.
Food Options • Strategy Pattern to control restrictions on the order • Template Pattern to build the food Order • Decorator Pattern to add toppings to the food order
Decorator Pattern for Food Orders • Adds Toppings/Condiments to the food order • Allows for toppings to be added to any food item , within that items restrictions, without having an individual class for each possible combination • Allows for easy addition of more toppings, or food options