RU Burgers
A restaurant ordering app, built twice: once for the desktop with JavaFX and once for Android.
Customers build burgers, sandwiches, sides and drinks with add-ons, combine them into combos, review the current order and place it, and the store keeps an order history. Every item knows its own price, and the order adds them up with New Jersey sales tax.
Both versions share the same model classes for menu items and orders. The desktop app draws them with JavaFX views and controllers, and the Android app with activities and fragments.
Desktop app
JavaFX views and controllers
Android app
Activities and fragments
Shared model
Menu items, combos, orders
- Desktop app and Shared model
- Android app and Shared model
See it work
The menu as classes
MenuItem
Abstract: price()
Sandwich
Bread, protein, add-ons
Burger
Extends Sandwich
Beverage
Size, flavor
SideOrder
Combo
Sandwich, drink, side
Order
List of items, subtotal, tax
- Order to MenuItem: holds
- MenuItem to Sandwich
- Sandwich to Burger
- MenuItem to Beverage
- MenuItem to SideOrder
- MenuItem to Combo
Pricing rules, from the code
| Rule | How it's priced |
|---|---|
| Double patty | Protein price + $2.50 |
| Combo | Sandwich + drink + small side, minus $1.00 |
| Sales tax | 6.625% of the subtotal, New Jersey's rate |