CS636 Pizza Project:  Pizza1 = Client-Server Implementation

A college, to attract more students, has decided to offer free pizza in the dormitory.  You have been selected to implement the needed automated ordering system.  Eventually, of course, you want to offer a web page for ordering pizza, but as a first step you implement it in the simple client-server methodology, and later migrate it to web-based UI.  

The pizzas will be available in 3 sizes, small, medium, and large, or possibly other sizes.  Toppings beyond the basic tomato sauce and cheese can be selected from an expandable set of options:

That is, a student can order any subset of these toppings, or none at all.  The dormitory room number and current day is remembered as well, for reporting. The students should be able to ask (by room number) if their pizza is done, and its size and toppings, i.e., all information on pizzas ordered so far today for this room.  When a student acknowledges receipt of the pizza(s) for a room, those pizza orders are marked completed.  

The pizza shop admin tells the system when the next pizza is done (they are cooked in order, and take the same amount of time), and when a day is done. When a day is done, all the orders are complete for that day.

The pizza shop admin can add and delete toppings and sizes, and set up shop from scratch. Also, the admin should be able to ask for information on all the pizzas ordered so far today that are not yet complete, the “in progress” orders.

Pizzas are tracked in the system by their status: PREPARING just after order is placed, BAKED a while later, FINISHED after receipt by student or end of day.  Days are tracked by simple day number that is incremented by the admin’s finish-day action.

Actions for Students

Actions for Admins

The system has a UI for the students, and a UI for the pizza shop admin, who runs the shop.

Solution Features

There are three programs, sources in package presentation

  1. TakeOrder, for student orders and status reports on pizza orders.
  2. ShopAdmin, admin's program, for admin actions
  3. SystemTest system test program, inputs from test.dat (see below)

The build.xml in the pizza1 directory has targets clean, build, oraSysTest, mysqlSysTest, and hsqlSysTest. The TakeOrder and ShopAdmin programs are too interactive to be run under ant.

The build.xml in the pizza1/database directory has targets load-oradb, show-oradb, drop-oradb, and similar targets for mysql and hsqldb. It also has targets to help run hsqldb.

The build.xml in the pizza1 directory has targets to run SystemTest using each of the three databases, once the database has been loaded with load-oradb or whatever.

The system has a SystemTest that reads and executes commands in test.dat as follows:

        ai         admin initializes system (after “ant load-oradb” for example)
        so 5       student order from room 5
        so 1       student order from room 1
        ss  5      status of orders from room 5  (answer—one PREPARING)
        anr        admin reports next pizza done (the one for room 5)
        ss  5      status of orders from room 5  (answer--one, now BAKED)
        aip        admin report on in-progress orders (one PREPARING, one BAKED)
        sr 5       student receives the room-5 order (acknowledges its receipt)
        ss 5       status of orders from room 5  (answer—one FINISHED)
        aip        admin report on in-progress orders (one PREPARING)
        aad        admin advances day (so pizza for room 1 is now FINISHED)
        aip        admin report on in-progress orders (none)

Note that the ai command add one topping, Pepperoni, and one pizza size, small, to get the system usable.

Unit tests: The sources with names *Test.java are unit tests, that is, individual tests of small parts of the system. Don't worry about them on first reading.