Assignment Class, Object and Use Case Diagrams: Task 01: Aggregation Vs Composition (10 Scores)

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Assignment

Class, Object and Use case Diagrams

Task 01: Aggregation vs Composition (10 Scores)


1. Give us four examples of a part-whole relationship, two examples of an
aggregation and two examples of a composition relationship.
Argue for each of the four cases why it is an aggregation or an
composition respectively. (Such an argument would consist of the generic
criterion for choosing the respective type of association and one or two
sentences arguing why the criterion applies here.)

Answer:

1) Aggregation:A special form of association that models a whole-part


relation between the whole and its parts, in which a whole is related to its
parts.

City - Tree:The whole is City, the part is Tree. The Tree is a part of City,
but it also can live independently.

Car - Engine:The whole is Car, the part is Engine. The Engine is a part of
Car, but it also can live independently.

2) Composition:A stronger form of association that parts are usually


expected to “live” and “die” with the whole.

Hand - Finger:The whole is Hand, the part is Finger. The Finger is a part of
Hand, but it exists only as part of the Hand.

Bird - Wing:The whole is Bird, the part is Wing. The Wing is a part of Bird, but it
exists only as part of the Bird.

Task 02: Create class diagram (10 Scores)

2. Draw Class diagram for library system with following classes: Member,
Librarian, Teacher, student, copy, and book.

Answer:
Describe each of the following elements what they mean (one word or a
short sentence)
 Attributes:Variables.
 Methods:Behaviour features of class.
 Relationships:A state of relatedness between class.
 Multiplicity:The specification of how many instances a class can
have.

Task 03: Create Class and Object diagram (10 Scores)


3. a) Draw the class diagram. Model the relationship of a role, president with
his country. 
Please do the following:
Create the class diagrams with attributes, methods and add multiplicities
to all association ends.( add for each of the classes minimum three
meaningful attribute and at least one method)
Answer:
b) Then create an object diagram that conforms to the class diagram
containing at least two presidents.
Answer:
Task 04: Create Use Case diagram (20 Scores)
Do the following:
Class 20: Choose Questions 4th & 5th
Class 21: Choose Questions 6th & 7th
4. Develop the Use Cases for a Library System
– supports library
– library lends books and magazines to borrowers who are registered in the
system, as are books and magazines
– library buys new titles, eventually in multiple copies
– Old books and magazines are removed when out of date
– borrower can reserve a book or magazine not currently available
Answer:

5. Develop the Use Cases for East China University of Technology (ECUT)
Registration System.
– Professors indicate which courses they will teach on-line

– A course catalog can be printed

– Allow students to select on-line four courses for upcoming semester

– No course may have more than 10 students or less than 3 students

– When the registration is completed, the system sends information to the billing
system
– Professors can obtain course rosters on-line

– Students can add or drop classes on-line


Answer:

6. Develop the Use Cases for online shopping of books

7. Create use case diagram for a simple hotel information system.


– Tour Group customers and Individual customers

– Tour Group customers are those who have made reservations through a tour
operator in advance, while Individual customers make their reservations directly
with the hotel

– Both types of customers can book, cancel, check-in and check-out of a room by
phone or via the Internet

Due date: Monday, 18.05.2020, 08:00AM

You might also like