You are on page 1of 4

UML Diagrams

Name: Gurkirat Singh


Student ID: 300187463

Note:

You can either use Visual Paradigm or draw manually on paper. If you choose to draw on paper,
simply take a picture of your drawing and insert it into this document.

Problem Scenario: Library Management System

Background

You are part of a software development team that has been contracted to build a Library Management
System for a local library. The system will handle tasks such as tracking books, managing user accounts, and
facilitating book checkouts and returns.

Requirements

1. User Accounts: The system should manage accounts for library staff and patrons.
2. Book Tracking: The system should keep track of books, including their titles, authors, and availability
status.
3. Checkouts and Returns: Patrons should be able to check out and return books. Staff should be able to
process these transactions.
4. Overdue Notifications: The system should notify patrons if a book is overdue.
5. Search Functionality: Both staff and patrons should be able to search for books.
6. Reports: Staff should be able to generate reports on book inventory and overdue books.

Tasks

1. Class Diagram with Cardinality: Create a class diagram that represents the main entities in the system,
their attributes, methods, and relationships, including cardinality.

1. Library
- Attributes: name, location
- Methods: addBook(), removeBook(), addUser(), removeUser()
2. Book
- Attributes: title, author, ISBN, status
- Methods: checkout(), returnBook()
3. User
- Attributes: userID, name, email
- Methods: searchBook() Two marks are allocated for each class
4. Staff (Inherits from User) diagram, and five marks are designated for
- Attributes: staffID, position the cardinality and the overall quality of the
- Methods: generateReport() diagram.
5. Patron (Inherits from User)
- Attributes: patronID, dueDate
- Methods: checkout(), returnBook()
6. Transaction
- Attributes: transactionID, date, status
- Methods: create(), close()
UML Diagrams

Provide the cardinality and the rationale. [6 marks]

Cardinality Rationale
What’s the cardinality between a 1 Library has many Books (1..*) A single library can house
Library and Book(s) ? thousands or even millions of
books, depending on the size and
capacity of the library.
What’s the cardinality between 1 Library has many Users (1..*) Libraries serve a community of
Library and User(s)? users, including both staff and
patrons. A library can have
numerous staff members and
patrons who use its services and
resources.
What’s the cardinality between 1 Patron can have many A patron can engage in multiple
Patron and Transaction(s)? Transactions (1..*) transactions, including checking out
and returning books. It's common
for patrons to have multiple
transactions associated with their
account as they borrow and return
books over time.
What’s the cardinality between 1 Transaction is associated with 1 Each transaction involves a specific
Transaction and Book(s)? Book (1..1) book. A book can be checked out or
returned as part of a single
transaction. Therefore, the
cardinality indicates a one-to-one
relationship between a transaction
and a book to ensure accurate
book tracking in each transaction.

Notes:
UML Diagrams

(a) Patron refers to an individual who uses the library's services for borrowing books, accessing resources,
and other library-related activities.
(b) Both Staff and Patron can be categorized as User

2. Use Case Diagram: Create a use case diagram that shows the different types of users and the actions they
can perform. [7 marks]

- Actors: Staff and Patron


- Use Cases:
o Search for Book
o Check Out Book
o Return Book
o Generate Report
o Notify Overdue

3. Activity Diagram: Create an activity diagram that describes the process of checking out a book. [5 marks]

Activities:

1. Search for Book


2. Select Book
3. Confirm Availability
4. Process Checkout
5. Update Book Status
6. Generate Transaction
7. Close Transaction

Deliverables
UML Diagrams

- Class Diagram with Cardinality


- Use Case Diagram
- Activity Diagram

You might also like