University of Helsinki
Department of Computer Science
©Harri Laine
Introduction to Applications Design
581327-6, autumn 2000

Exercise 3 (20.11-24.11.)

  Reading material:
  • Booch G., Rumbaugh J. and Jacobson I.:The Unified Modeling Language User Guide,Addison-Wesley, 1998: chapters 1, 2,3, 4, 5, 8, 9 (pp. 123,127-130), 10 (pp. 143-144, composition & association class: 146-148)
  • Holub: UML reference card
  • Mark Randall: Object oriented design (lecture notes)
    (only classes, objects, attributes, associations and dependencies and how to build a class diagram)

1. Travel agency FarAway needs a system for marketing its products in WWW. Users should be able not only to view the information but also to make reservations on the trips and to post comments about their trips. Each tour will have a description. This description contains a general description of the destination and a desription of accommondation choices. The general description contains descriptive text and pictures, the flight schedule and the dates of departures. The description of an accommondation choice contains the name and address of the hotel or the apartment hotel, a description of the types of rooms or appartments and their amount. 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 amount, and the price for an extra week. Reservations are booked for the selected room type. They are identified by reservation numbers. 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 the class candidates in the previous text. Evaluate their suitability for classes based on the following criteria:

  • do the instances of the class have attributes the value of which is necessary in the system
  • is the information about the existence of instances of the class necessary
  • is the 'class' essential for the system
Pick up the classes.

2. Complete the class model of task 1 by including attributes and associations. Present the result as an UML class diagram.

3. A library collection consists of books and magazines. The magazines are gathered into annual volumes. There may be many copies (books) of the same title. The library customers may search for works according to search words (writer, title, the name and number of a magazine). In addition, they may borrow books. When a customer borrows a book, her/his name, an ID of the borrowed book, the date and the due date are recorded. The customer may also make a reservation for a title that is not available at the moment. The reservation contains information on the customer, the title and the date of reservation. Magazines cannot be borrowed, they must be read in the library. Create a class diagram that describes the data contents of the system. Pay special attention to whether the classes are dependent for their existence on each other. Present the possible existence dependencies through compositions.

4. Create an object diagram according to exercise 3, 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.

5. Task 3 of exercise 2 consirered the use cases of the course bookkeeping system. Draw the use case specific class diagrams for the use cases
  • register the number of home work tasks done by a student for a certain exercise
  • show the final results
  • determine the grades
The exam points affect directly to the final points used for detemining grades. Exercise and practice points affect indirectly according to specified transformation table. To determine the grades you must determine the transformation tables tor exercise and practice points and the point limits for the grades.

6. Draw object diagrams as examples for each of the class diagrams of task 5.

PS In addition to the CASE tools listed in exercise 2 there are other free tools, for example, argo/ULM (made in Java and work in both Linux and Windows). This tool may be loaded from http://argouml.tigris.org .

1.11.2000 Harri Laine