Exercise 3 (18.11.-22.11.) |
Reading material for these exercises:
Reading material for the next week:
Tasks
2. Create an object diagram corresponding to your class diagram of the library, describing the following things: John Smith (ID 99999) has borrowed two books: Dostoyevski's Crime and Punishment (ID 12345) and Linnaeus' Species of Plants (ID 67890) on 30th March 2000. At the same time, he has reserved the book Wildlife in Savo (67891), edited by Blossom Hayfield. Jane Jones has borrowed Herman Hesse's Steppenwolf (54321) and another copy of Dostoyevski's Crime and Punishment (12344). In addition, she has reserved Dostoyevski's The Brothers Karamazov
3. Travel agency FarAway needs a system for marketing its products in WWW. The users should be able to view the information and also to make reservations on the trips and to post comments about their trips. Each tour has a description consisting of a general description of the destination and a description of the accommodation choices. The general description contains descriptive text and pictures, the flight schedule and the dates of departures. Each accommodation choice description contains the name and address of the hotel or the apartment hotel, a description of the types of rooms or appartments and their number, the base price for a one week tour (for a room type and a given number of persons), the price of extra beds and their maximum number, and the price for an extra week. Reservations are booked for the selected room type and identified by reservation number. A reservation specifies the name and address of the customer, the names and dates of birth for the travellers, the departure date, the duration of the trip, and the reservation's state of processing. Underline all class candidates in the previous text. Evaluate their suitability for classes based on the following criteria:
Candidate | Comment | Decision |
---|---|---|
travel agency | only one instance, no attributes spesified | no |
product | a generalisation, synonym to trip or tour | no |
trip | tour taken, could be synonym to reservation | no |
comment | feedback to be collected, object | yes |
tour | product to be sold, object | yes |
reservation | deal made, essential object | yes |
destibation=resort | there are resort specific information. This should be selected if there are more than one types of tours to the same resort, otherwise resort information may be attached to tour (we assume one one type of tour for each resort) | no |
traveller | customer who travels,role | no |
accommodation choice | targets for reservations | yes |
descriptive text | no | |
picture | might be technically object, but logically attribute | no |
flight schedule | collection of information, we are more interested in individual departures | no |
departure | potential starting time, essential | yes |
hotel | participant in the process | yes |
apartment hotel | subclass of hotel, non-essential | no |
room type | many attributes | yes |
customer | customer,ok, but this has to meaning also paying customer association | yes |
The description text above does not tell it directly but one rese4rvation may contain many room resrvations and many flight reservations. these should also be considered as class candidates and selected as classes.
When we try to determine how the selected classes are associated to each other we obtain the following diagram:
4. Complete the class model of task 1 by including attributes and associations. Present the result as an UML class diagram.
5. The products of Alfonso's pizza service include pizzas, sandwiches, salads, pastas and drinks. Each product type may be available in different size of portions. The prices depend on the product and the size of the portion. Extras like carlic, parmesan cheese, and mushrooms are also available. Extras are priced separately from products. Alfonso's product catalog explains in detail what ingredients are used in each product. Extras are included in ingredients. All ingredients, such as pizza dough, are not anyhow sold as extrass. An order may contain many portions each with none or many accompanients. The information system should take care of the maintaining of the product data and the pricing information. It should also support the processing of the orders. Draw an UML class diagram to describe the information contents of the system. Suplement the above description with the missing details.
Pizza diagram as PLA-file for Plastic Lite