Object Modelling Using UML – Extended Class Notes
1. Unified Modeling Language (UML)
UML is not a programming language but a modeling language that helps software engineers:
• Design systems visually.
• Document design decisions.
• Communicate ideas effectively among stakeholders.
Real-World Analogy: Think of UML like blueprints for a building. They don't build the building, but they are
essential for designing it before construction starts.
Use in Development Phases:
• Requirement Analysis: Use Case Diagrams
• Design: Class, Sequence, Activity, State Diagrams
• Implementation & Testing: Class and Component Diagrams
2. UML Diagrams Overview
Diagram Type Description View Type
Class Diagram Static structure of classes and relationships Structural
Use Case Diagram Interactions between users and system Functional
Activity Diagram Workflow of processes Behavioral
Sequence Diagram Time-sequenced object interactions Interaction
Communication Diagram Object collaboration Interaction
Statechart Diagram Lifecycle of an object Behavioral
3. Use Case Model
Extended Example – Library Management System:
• Actors: Librarian, Member
• Use Cases: Issue Book, Return Book, Search Catalog, Pay Fine
Real-Time Usage:
• Helps in stakeholder meetings to gather requirements.
1
• Used by QA teams to derive test cases.
Diagram Tip: Always place actors outside the system boundary box, use lines without arrows to connect to
use cases.
4. Class Diagram
Detailed Example – Hospital Management System:
• Classes: Patient, Doctor, Appointment, Prescription
Relationships:
• A Doctor can have multiple Appointments (1-to-many)
• A Prescription is composed of multiple Medicines (composition)
Design Note:
• Show access modifiers: "+" (public), "-" (private), "#" (protected)
• Abstract classes italicized
Diagram Insight:
+-------------------+
| Doctor |
|-------------------|
| -id: int |
| -name: String |
|-------------------|
| +prescribe(): void|
+-------------------+
5. Activity Diagram
Example – Online Food Delivery System:
• Activities: Select Food → Place Order → Payment → Track Delivery → Receive Food
Key Concepts:
• Guards (conditions) on decision branches: [Payment Success] / [Payment Fail]
• Merge nodes help combine branches
Diagram Tip: Use rounded rectangles for actions, diamonds for decisions, bars for forks/joins.
2
6. Interaction Diagrams
a) Sequence Diagram
Example – Booking a Train Ticket:
• Objects: User, Booking Page, Payment Gateway, Confirmation Page
Message Flow:
1. User logs in
2. Selects train
3. Proceeds to payment
4. Receives confirmation
Design Detail:
• Use return messages (dashed arrows) for acknowledgements
• Activation boxes show object is "doing something"
b) Communication Diagram
Example – Chat Application:
• Objects: User1, User2, Server
• Message Numbers: 1, 1.1, 1.2 to represent call order
7. Statechart Diagram
Detailed Example – Order Lifecycle:
• States: New → Processing → Shipped → Delivered → Cancelled/Returned
• Transitions triggered by: payment confirmation, shipping, delivery
Key Features:
• Entry/exit actions: entry/do: or exit/do:
• Internal events do not trigger state changes but cause activities
Diagram Tip: Use a filled black circle for initial state and a circle with a dot for final state.
8. Object-Oriented Analysis and Design (OOAD)
Extended Phases & Real-World Examples:
3
1. OOA – Object-Oriented Analysis
• Focus: What the system should do
• Tools: Use Case Diagrams, Class Diagrams
• Example: Analyzing user roles and goals in an e-learning platform
2. OOD – Object-Oriented Design
• Focus: How the system will do it
• Tools: Sequence Diagrams, Activity Diagrams, State Diagrams
• Design Patterns: Singleton, Observer, MVC used here
Example Project – Ride Booking App:
• OOA: Identify classes like Rider, Driver, RideRequest
• OOD: Define interactions using sequence diagrams
9. Design Principles in Practice (From Pressman)
Principle Description
Encapsulation Bind data and methods that operate on data
Inheritance Derive new classes from existing ones
Polymorphism Same operation behaves differently on classes
Abstraction Focus on essential attributes and hide complexity
Class Example Demonstrating All Four:
abstract class Vehicle {
int speed;
abstract void move(); // Abstraction & Polymorphism
}
class Car extends Vehicle {
void move() { System.out.println("Car moves on roads"); } // Inheritance &
Polymorphism
}
4
Conclusion
These detailed notes extend the foundational content by Pressman and provide real-world analogies,
diagrams, and modeling tips that make UML and OOAD highly applicable in software engineering
education and practice. These can be used for lectures, assignments, or self-study.
Would you like accompanying visual diagrams or example problems with answers next?