4.1 Rosa's Breakfast Service
The example we will be exploring in this book is the ordering system for Rosa's Breakfast Service. The example system described in this and subsequent chapters is implemented using the OptimalJ tool. You can download OptimalJ and the example at the Web site http://www.klasse.nl/mdaexplained.
4.1.1 The Business
Rosa has founded a company that supplies a complete breakfast delivered to the homes of its customers. Customers can order from one of the breakfast menus on Rosa's Web site, indicate the hour and place of delivery, give their credit card number, and the ordered breakfast will be delivered. Rosa's slogan is: "Surprise your husband, wife, lover, valentine , mother, father, or friend on their special day while still enjoying the comfort of your bed."
Rosa has composed a series of breakfasts, each of which comes with special decorations. For instance, the Valentine breakfast is served on plates decorated with small hearts and cupids, with matching napkins. The items served are set by the choice of breakfast. For instance, if you choose the French breakfast, you will get one cup of coffee, one glass of orange juice , two croissants and one roll, butter, and jam. But if you choose the English breakfast, you will get two fried eggs and bacon, three pieces of toast , marmalade, and a pot of tea. The Champagne Feast breakfast, which always serves two persons, includes a bottle of champagne , four baguettes, a choice of french cheese and p t s, and a thermos bottle filled with coffee (to sober up afterwards). Orders can be filled for any number of people, where any in the party may order a different breakfast.
The items served are set, but customers can indicate the style in which the breakfast is served. They can choose between simple , grand , and deluxe . A simple breakfast is served on a plastic tray with carton plates and paper napkins. The orange juice glass, when included, is made of plastic, too. A grand breakfast is served on a wooden tray with pottery plates and cups, and simple white cotton napkins, and the glass is made of real glass. A deluxe breakfast is served on a silver tray with a small vase with some flowers. The plates are fine pottery plates and the napkins are decorated, made from the finest linen. Obviously, the price of the breakfast is higher when the serving style is better. Some breakfast types, like the Champagne Feast, can be ordered in the grand or deluxe style only.
Rosa has ten employees that come in her kitchen at half past five in the morning and work until noon. Five of them take care of deliveries, and five do the cooking and preparation of the breakfasts. Rosa's kitchen is located next to a bakery. The first thing Rosa does in the morning is get fresh bread from the bakery. All other ingredients are kept in supply. Twice a week their inventory is resupplied.
Rosa wants to give her customers a bit of flexibility. Customers may, after choosing a standard breakfast as basis, decide to put in extra comestibles, alter the amount of certain parts, and even remove parts from the breakfast. So, if you like the Champagne Feast breakfast, you may order two bottles of champagne instead of one, add another baguette, and leave out the smelly cheese and the coffee (coffee won't help after two whole bottles of champagne anyhow).
4.1.2 The Software System
In this example we are not very interested in the delicious breakfasts Rosa makes; instead, we look at the system needed to support Rosa's business. The ordering system is a standard Web-based, three- tier application. There will be two different Web interfaces, one for the customers, and one for Rosa's employees to indicate which breakfasts they need to make and deliver. If the customer agrees, his or her name and address will be kept in the system. This will enable Rosa to give a discount to regular customers.
The customer Web interface must respond to the customer information. When a known customer logs in, a list of previous orders must be shown with the option to repeat that order. The database should hold customer information: the name, price, and contents of all breakfast types offered , and the ordering information. The middle-tier will primarily add orders and customers to the database.
We have decided to use a three-tier architecture for Rosa's system. Of course, other choices could be made, and the decision on what architecture to use must be made carefully , but that is not the subject of this book. The three-tier application will consist of a database, a middle tier using Enterprise Java Beans (EJB), and a user interface built with Java Server Pages (JSP).