0% found this document useful (0 votes)
33 views4 pages

UML Diagram Scenarios

The document presents four scenarios involving university software engineering students creating various UML diagrams for their assignments. Aisha designs an Entity-Relationship Diagram for a textbook rental platform, Ben creates a Sequence Diagram for a food ordering app, Chloe develops a Class Diagram for a library management system, and David outlines a Use Case Diagram for a movie streaming service. Each scenario highlights the purpose of the respective diagram in aiding the students' understanding of system design and functionality.

Uploaded by

chapterbave
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views4 pages

UML Diagram Scenarios

The document presents four scenarios involving university software engineering students creating various UML diagrams for their assignments. Aisha designs an Entity-Relationship Diagram for a textbook rental platform, Ben creates a Sequence Diagram for a food ordering app, Chloe develops a Class Diagram for a library management system, and David outlines a Use Case Diagram for a movie streaming service. Each scenario highlights the purpose of the respective diagram in aiding the students' understanding of system design and functionality.

Uploaded by

chapterbave
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Here are scenarios for a university software engineering student needing to draw various

UML diagrams:

Scenario 1: Entity-Relationship Diagram (ERD)


Student: Aisha, a third-year software engineering student. Course: Database Systems.
Assignment: Design a database for a new online textbook rental platform for university
students.

Situation: Aisha's professor has tasked the class with conceptualizing the database schema
for "BookWorm Rentals," a system where students can rent textbooks for a semester. The
system needs to track textbooks, students, rentals, and overdue books. Aisha realizes she can't
jump straight into SQL tables. She needs to understand the core data elements and their
relationships first to ensure data integrity and avoid redundancy.

Why an ERD is needed: An ERD is the perfect tool for Aisha to visually represent the
entities (e.g., Student, Textbook, Rental), their attributes (e.g., studentID, textbookISBN,
rentalDate), and the relationships between them (e.g., "A Student rents a Textbook," "A
Textbook can be included in multiple Rentals"). This will help her identify primary and
foreign keys, understand cardinality (one-to-many, many-to-many), and ultimately design a
robust and efficient database. She'll be able to answer questions like: "Can a textbook be
rented by multiple students simultaneously?" or "Does a student need to exist in the system
before renting a book?"

Scenario 2: Sequence Diagram


Student: Ben, a final-year software engineering student. Course: Software Design and
Architecture. Project: Developing a mobile application for ordering food from campus
restaurants.

Situation: Ben is working on the "CampusEats" app. He's at the stage where he needs to
clearly define how a user places an order, from selecting items to receiving confirmation.
Multiple components are involved: the mobile app frontend, the backend API, the restaurant's
system, and a payment gateway. Ben needs to visualize the flow of messages and interactions
between these different parts to ensure smooth operation and identify potential
communication bottlenecks.

Why a Sequence Diagram is needed: A Sequence Diagram will allow Ben to illustrate the
chronological order of messages exchanged between objects or actors within the "Place
Order" use case. He can show:

 The user interacting with the mobile app (e.g., User -> Mobile App:
selectFoodItem())
 The app communicating with the backend (e.g., Mobile App -> Backend API:
submitOrderRequest())
 The backend interacting with the payment gateway (e.g., Backend API -> Payment
Gateway: processPayment())
 And finally, the confirmation sent back to the user (e.g., Backend API -> Mobile
App: sendOrderConfirmation()).
This diagram will be crucial for him to discuss the interaction flow with his team, identify
potential race conditions, and refine the API calls.

Scenario 3: Class Diagram


Student: Chloe, a second-year software engineering student. Course: Object-Oriented
Programming (OOP) with Java. Assignment: Build a simplified library management system.

Situation: Chloe is tasked with developing a system that allows librarians to manage books
and members. She knows she needs to use object-oriented principles, but she's struggling to
define the different "types" of things in her system (e.g., a book, a member, a loan) and how
they relate to each other in terms of attributes and behaviors. She's getting confused about
which data belongs to which object and how they should interact.

Why a Class Diagram is needed: A Class Diagram is essential for Chloe to model the static
structure of her system. She can define classes like Book (with attributes like title, author,
ISBN), Member (with attributes like memberID, name, contactInfo), and Loan (with attributes
like loanDate, dueDate). More importantly, she can define the relationships between these
classes (e.g., "A Member can borrow multiple Books," "A Book can be part of many
Loans"). She can also define methods (behaviors) for each class (e.g., Book: checkout(),
Member: register(), Loan: renew()). This diagram will clarify her object model, promote
proper encapsulation, and serve as a blueprint for her Java code.

Scenario 4: Use Case Diagram


Student: David, a first-year software engineering student. Course: Introduction to Software
Engineering. Assignment: Analyze the requirements for a new online movie streaming
service.

Situation: David's first major assignment is to understand and document the functionalities
of a new online movie streaming service, "StreamFlix." He needs to identify who will use the
system and what they will be able to do. He's overwhelmed by all the potential features
(Browse, searching, subscribing, watching, reviewing, parental controls, etc.) and needs a
high-level overview before diving into detailed design.

Why a Use Case Diagram is needed: A Use Case Diagram is the perfect starting point for
David. It will allow him to identify the main actors (e.g., Registered User, Guest User,
Administrator, Payment Processor) and the high-level functionalities (use cases) they can
perform with the system. He can draw use cases like:

 Browse Movies
 Search for Movie
 Stream Movie
 Subscribe to Service
 Manage Profile
 Add Movie (Administrator)

He can also show relationships between use cases, such as <<include>> (e.g., Stream Movie
includes Authenticate User) or <<extend>> (e.g., Stream Movie extends to Rate Movie).
This diagram will provide a clear, concise overview of the system's scope and functionalities
from the user's perspective, helping him to organize his thoughts and communicate the
system's requirements effectively to his instructors and potential stakeholders.

here's an Entity-Relationship Diagram (ERD) for Aisha's "BookWorm Rentals" platform:

Code snippet
erDiagram
STUDENT ||--o{ RENTAL : "rents"
TEXTBOOK ||--o{ RENTAL : "is_part_of"
RENTAL ||--o{ OVERDUE_CHARGE : "generates"

STUDENT {
VARCHAR studentID PK
VARCHAR firstName
VARCHAR lastName
VARCHAR email UNIQUE
VARCHAR phoneNumber
}

TEXTBOOK {
VARCHAR textbookID PK
VARCHAR title
VARCHAR author
VARCHAR ISBN UNIQUE
DECIMAL rentalPricePerSemester
INT quantityAvailable
}

RENTAL {
VARCHAR rentalID PK
VARCHAR studentID FK
VARCHAR textbookID FK
DATE rentalDate
DATE dueDate
DATE returnDate
BOOLEAN isReturned
}

OVERDUE_CHARGE {
VARCHAR chargeID PK
VARCHAR rentalID FK
DECIMAL amount
DATE chargeDate
BOOLEAN isPaid
}

Explanation of the ERD:

 Entities (Rectangles):
o STUDENT: Represents a university student using the platform.
o TEXTBOOK: Represents a textbook available for rent.
o RENTAL: Represents a specific instance of a student renting a textbook. This is an
associative entity as it connects STUDENT and TEXTBOOK and has its own attributes
(like rentalDate and dueDate).
o OVERDUE_CHARGE: Represents a charge incurred when a rental is returned late.

 Attributes (Listed within Entities):


o Primary Keys (PK): Unique identifiers for each entity (e.g., studentID,
textbookID).
o Foreign Keys (FK): Attributes that link to a primary key in another entity, establishing
relationships (e.g., studentID and textbookID in RENTAL).
o Other relevant attributes (e.g., firstName, title, rentalDate).
o UNIQUE constraint for email in STUDENT and ISBN in TEXTBOOK to ensure no
duplicates.

 Relationships (Lines with Crow's Feet and Circles):


o STUDENT rents RENTAL (One-to-Many):
 A single STUDENT can have zero or many (o{) RENTAL records.
 Each RENTAL record belongs to one and only one (||) STUDENT.
o TEXTBOOK is_part_of RENTAL (One-to-Many):
 A single TEXTBOOK can be included in zero or many (o{) RENTAL records.
 Each RENTAL record involves one and only one (||) TEXTBOOK.
o RENTAL generates OVERDUE_CHARGE (One-to-Zero-or-One):
 A single RENTAL can generate zero or one (o{) OVERDUE_CHARGE (only if it's
returned late).
 Each OVERDUE_CHARGE is associated with one and only one (||) RENTAL.

This ERD provides a clear conceptual model for Aisha, allowing her to visualize the database
structure before moving on to the logical and physical design in SQL.

You might also like