{***************************************************************************** **** This RSL file is an example of what Milestone 3 should look like. **** *****************************************************************************} {**** **** OBJECTS ****} object RestaurantDB components: FoodMenu and FoodStuffsInventory and FoodItemBreakdowns; operations: MaintainDB; description: { The RestaurantDB is the repository of all electronic restaurant information. The three main components are the menus seen by the customer, the food stuffs inventory that records all current stock on hand, and the food item breakdowns that describes the food stuffs that each menu item is composed of. }; end RestaurantDB; {* * The next several objects define the food menu seen by customers. *} object FoodMenu components: MenuSection*; description: { The FoodMenu is the top-level structure of menu seen by the customer from which order selections are made. It is composed of a number of MenuSections. The standard menu sections are Hamburgers, }; end FoodMenu; object MenuSection components: MenuItem*; description: { Each MenuSection of the menu consists of a list of indivdual menu items. For example, the hamburgers section contains a menu item for each of the different kinds of hamburgers }; end MenuSection; object MenuItem components: Name and Description and Price and Accessories; description: { Each MenuItem in a MenuSection has these components. Four example, a MenuItem for a plain hamburger is the following: Name: "Plain Hamburger" Description: "1/4 LB patty" Price: "$1.89" Accessories: "Mayonaise", "Mustard", "Catsup", "Lettuce", "Tomato", "Pickles", "Onion", "Cheese", "Mushrooms" Note that the list of accessories includes an indication of whether a particular extra is or is not normally included, which detail is not shown here. See the definition of the Extras object below for details. }; end MenuItem; object Accessories components: Accessory*; description: { This is the list of accessory items that can appear with a MenuItem. Accessories is also a component of the FoodItemBreakdown object defined farther below. }; end Accessories; object Accessory components: Name and IsStandard and Requested and ExtraRequested and Price; description: { Each Accessory has a name, an indication as to whether it is standard, an indication as to whether it has been requested by the customer, an indication as to whether extra has been requested, and a price. For example, here is the structure of a mayonaise accessory for a standard hamburger: Name: "Mayonaise" IsStandard: true Requested: true Extra: false Price: "no charge" This example indicates that Mayonaise is standard, it has been requested by the customer, no extra is requested, and there is no charge for it. If an Accessory is standard, then it is normally included on a food item unless the customer explicitly requests that it be removed. The converse is true for non-standard a Accessory. The ExtraRequested flag allows the customer to select extra of an Accessory, i.e., double it. If ExtraRequested is true, then the Price is doubled. }; end Accessory; object IsStandard = boolean; {* * The next two objects define the restaurant inventory structure. *} object FoodStuffsInventory components: FoodStuffsItem*; description: { FoodStuffsInventory is the inventory of raw food items, such as burger patties, buns etc. This inventory contains a description of all stock on hand. }; end FoodStuffsInventory; object FoodStuffsItem components: Name and Quantity and Units; ops: ; description: { A foods stuffs inventory item consisting of a name, quantity, and unit of measurement. For example, if there are 500 hamburger patties on hand, then the inventory entry is: Name: "Patty" Quantity: 500 Unit: "1/4 LB" }; end FoodStuffsItem; {* * The next three defs are for atomic objects refereneced in FoodStuffsItem, * and elsewhere. *} object Name = string; object Quantity = number; object Units = string; {* * The next several objects define the food item breakdown list. *} object FoodItemBreakdownList components: FoodItemBreakdown*; description: { The FoodItemsBreakdownList contains the complete breakdown for each food item on the menu. Each breakdown describes exactly what raw food stuffs are need to prepare the menu item. }; end FoodItemBreakdownList; object FoodItemBreakdown components: Name and BasicParts and Extras; description: { A FoodItemBreakdown Describes the food stuffs components of customer-level food items. For example, the breakdown for a plain hambuger is: Name: "Plain Hamburger" BasicParts: "patty", "bun" Price: 1.89 Extras: "Mayonaise", "Mustard", "Catsup", "Lettuce", "Tomato", "Pickles", "Onion", "Cheese", "Mushrooms" Note that there is similarity between a FoodItemBreakdown object and the MenuItem object defined above. The difference is that a MenuItem is a description seen by the restaurant customer, whereas a FoodItemBreakdown is seen by the restaurant management and staff. The most important specific difference between the two types of object is that a MenuItem has a customer-oriented description, whereas a FoodItemBreakdown has a complete list of basic parts and extras. In general, the customer-oriented description will not contain a full list of all parts. For example, the customer-oriented description of a plain hamburger is "1/4 LB patty", whereas the basic parts list of a plain hamburger FoodItemBreakdown is the list consisting of "patty" and "bun". }; end FoodItemBreakdown; object BasicParts components: FoodStuffItem*; description: { The basic parts of a food item are those that are always included. For example, the basic parts of a hamburger are the patty and bun. }; end BasicParts; {* Reports *} object DBReports components: FoodItemList or InventoryList or IntervalInventoryReport; description: { There are three types of reports that the system will generate. A description of each is given below in the respective definitions. }; end DBReports; object FoodItemList components: FoodItemBreakdown*; description: { A FoodItemList is a listing of all the food items currently available on the food menu. This list can be sorted alpahbetically or by menu section. }; end FoodItemList; object InventoryList components: FoodStuffsItem*; description: { An InventoryList is a listing of all the raw food stuffs currently in the food stuffs inventory. The listing is sorted alphabetically. }; end InventoryList; object IntervalInventoryReport components: Interval and AnnotatedFoodItemList and AnnotatedInventoryList; description: { An IntervalInventoryReport is a listing of how many items sold in a given interval and how the inventory fluctuated during that time. The possible intervals are daily, weekly, monthly, and yearly. }; end IntervalInventoryReport; object DailyInventoryReport extends IntervalInventoryReport where: Interval = Day; description: { A DailyInventoryReport has inventory information for one day. }; end DailyInventoryReport; {* Definitions for Weekly, Monthly, and YearlyInvntoryReports need to be added. *} object Day components: DayName and DayDate and Month and Year; description: { A Day describes a single day in the calendar year, e.g., Wednesday 14 October 1991. }; end Day; {* Definitions for Week, Month, and Year need to be added *} {* Food Orders *} object CustomerOrder components: ItemOrder*; description: { The CustomerOrder is the collection of all individual item orders input by the customer. As the ordering operation is performed, the customer order is built up from the ordered items. }; end CustomerOrder; object ItemOrder components: ItemName and ItemAmount and ItemExtras and ItemUnitPrice and ItemExtrasPrice and ItemTotalPrice; description: { An ItemOrder contains all of the information that describes what a customer has ordered, including the item name, amount, extras, unit price, extras price, and total price. }; end ItemOrder; {* The next itmes need to be defined further. *} object CooksOrder = {. . .} end CooksOrder; object CustomerReceipt = {. . .} end CustomerReceipt; {* * The next four definitions are concrete object values that define the current * contents of the food menu. These constitute the default menu values, and * are changeable using the UpdateMenu operations defined below. *} value StandardMenu:FoodMenu = [BurgerSection, DrinksSection, SidesSection]; { A StandardMenu represents the actual menu structure as presently in place at the restaurant. } value BurgerSection:MenuSection = [PlainBurgerItem, DoubleBurgerItem, ChiliBurgerItem, SkinnyBurgerItem, KiddieBurgerItem]; { These are the current items in the Burger section of the standard menu. } value DrinksSection:MenuSection = [CokeItem, OrangeItem, SevenUpItem, DietCokeItem]; { These are the current items in the Drinks section of the standard menu. } value SidesSection:MeunSection = [FriesItem, OnionRingsItem, ApplePieItem]; { These are the current items in the Side Orders section of the standard menu. } {* * The next five objects are the definitions of the standard burgers. *} value PlainBurgerItem = [ (* Name: *) "Plain Hamburger", (* Description: *) "1/4 LB patty", (* Price: *) "1.89", (* Accessories: *) PlainBurgerAccessories ]; value DoubleBurgerItem = ["Double Hamburger", "Two 1/4 LB patties", "$2.69"]; {* * The next five objects will be the definitions of the standard burger * accessories. They need to defined fully. *} value PlainBurgerAccessories = []; {* * OPERATIONS *} {* Food Ordering *} operation OrderFood components: OrderBurger, OrderDrink, OrderSides, ComposeOrder; inputs: CustomerSelections, Menu; outputs: CustomerReceipt, CookOrder; precondition: {every item in the customer order is on the menu and in stock}; description: { Accumulate the individual customer entries and produce the food orders. The principal ordering constraint is that the customer-selected food item is on the input Menu. The Menu will be updated as necessary during normal business to reflect immediate changes in inventory. E.g., if hamburger patties are consumed, then the Burger items will be deleted form the menu (deletion is specified by marking the item as ``temporarily out of stock'' on the menu). It should be noted that this ordering constraint requires human intervention to remove an item from the menu. I.e., the manager must use the MaintainMenu function to perform the change. Other alternatives for ordering constraints were considered, in particular, having the system automatically remove an item from the menu when the online inventory indicates that some comoponent of a FoodItem is out of stock. This fully automatic operation was rejected on the grounds that the system may not have accurate information about the exact inventory on hand. E.g., if the cook uses more of some FoodStuffs item then is required and fails to report the overuse to the system, the system will indicate that there is more of the FoodStuffs item than is actually available. Instead of the fully automatic Menu update, the system will output a ``stock low'' warning on the manager's console (see the MaintainMenu function). }; end OrderFood; operation OrderBurger components: none; inputs: MenuSection = BurgerSection, BurgerSelections, CustomerOrder; outputs: CustomerOrder; description: { The OrderBurger operation accepts a customer order from the BurgerSection of the menu. The BurgerSelections are added to the CustomerOrder currently being tallied. }; end OrderBurger; operation OrderDrink components: none; inputs: MenuSection = DrinksSection, DrinkSelections, CustomerOrder; outputs: CustomerOrder; description: { The OrderDrinks operation accepts a customer order from the DrinksSection of the menu. The DrinkSelections are added to the CustomerOrder currently being tallied. }; end OrderDrink; operation ComposeOrder components: none; inputs: CustomerOrder; outputs: CustomerReceipt, CookOrder; description: { The ComposeOrder operation is invoked in repsonse to the customer indicating that the food order has been completed. ComposeOrder takes the completed CustomerOrder and produces a final CustomerReceipt and CookOrder. The CustomerReceipt is presented to the customer at the table in paper form. The CookOrder is sent to the kitchen, where it appears on an electronic monitor. The CookOrders should be received in the kitchen in first-come, first-served order. That is, }; end ComposeOrder; {* Database Management *} operation MaintainDB components: ValidateUser, MaintainMenu, MaintainInventory, MaintainBreakdowns, GenerateReports; inputs: RestaurantDB, DBUpdates, UserPassword; outputs: RestaurantDB, DBReports; description: { The MaintainDB operation manages all components of the restaurant database. MaintainDB performs password validation on the user, to ensure that only legitimate restaurant personnel may gain access to the databases. The three main suboperations of MaintaiDB are described below. }; end MaintainDB; operation MaintainMenu components: AddFoodItem, DelFoodItem, ChangeFoodItem, ListFoodItems; inputs: MenuUpdates, FoodMenu; outputs: FoodMenu, FoodItemList; description: { MaintainMenu allows new menu items to be added to the FoodMenu. It also allows existing menu items to deleted, changed, or listed. }; end MaintainMenu; {* The suboperations of MaintainMenu need to be defined. *} operation MaintainInventory components: AddDelivery, DeleteSpoilage, AddFoodStuffsItem, DelFoodStuffsItem, ChangeFoodStuffsItem, ListInventory; inputs: InventoryUpdates, FoodStuffsInventory; outputs: FoodStuffsInventory, IntervalInventoryReport; description: { MaintainInventory allows updates to the FoodStuffsInventory. The AddDelivery suboperation is invoked when vendor deliveries arrive. DeleteSpoilage is typically invoked at the end of the business day to update the inventory based on how much food spoiled or was damaged during restaurant operations. The Add, Del, and ChangeFoodStuffsItem operations provide the standard access to the inventory DB. Finally, the ListInventory operation is used to produce an IntervalInventoryReport. }; end MaintainInventory; {* The suboperations of MaintainInventory need to be defined. *} operation MaintainBreakdowns components: AddFoodItemBreakdown, DelFoodItemBreakdown, ChangeFoodItemBreakdown, ListFoodItemBreakdowns; inputs: BreakdownUpdates, FoodItemBreakdownList; outputs: FoodItemBreakdownList; description: { This operation maintains the FoodItemBreakdownList. It has the standard suboperations to add, delete, change, and list database items. }; end MaintainBreakdowns; {* The suboperations of MaintainBreakdowns need to be defined. *}