Solution Architect - UML Architectural Diagrams
Uses, When to Use Them, How to Draw Them, Importance, Examples, and Student Assignment
1) Introduction to UML
UML (Unified Modeling Language) is a standard visual language used to design, describe, and document software systems before or during development.
UML helps developers and stakeholders to:
- understand a system before coding,
- communicate clearly,
- reduce ambiguity,
- identify missing requirements,
- plan architecture,
- support maintenance and future improvements.
UML diagrams are not code. They are visual models of a system.
2) Why UML is Important
UML is important because it helps teams:
- see the big picture of a system,
- break complex systems into understandable parts,
- show how users and software interact,
- show structure, behavior, and deployment,
- improve team communication,
- support documentation for exams, projects, and real-world software.
In software engineering, UML is often used during:
- requirements analysis
- system design
- architecture design
- testing
- maintenance
3) Main Categories of UML Diagrams
UML diagrams are usually grouped into two broad categories:
A. Structural Diagrams
These show the static structure of a system.
Examples:
- Class Diagram
- Object Diagram
- Component Diagram
- Deployment Diagram
- Package Diagram
- Composite Structure Diagram
B. Behavioral Diagrams
These show how the system behaves over time.
Examples:
- Use Case Diagram
- Sequence Diagram
- Activity Diagram
- State Machine Diagram
- Communication Diagram
- Interaction Overview Diagram
- Timing Diagram
PART A: STRUCTURAL UML DIAGRAMS
4) Class Diagram
Purpose
A Class Diagram shows the classes in a system, their attributes, methods, and the relationships between them.
When to Use It
Use a class diagram when:
- designing the structure of a system,
- identifying entities in the system,
- modeling object-oriented software,
- explaining how data and behavior are organized.
Importance
- It is one of the most important UML diagrams in object-oriented design.
- It helps developers convert requirements into code.
- It shows the blueprint of the software.
How to Draw It
Each class is drawn as a rectangle with 3 parts:
- Class name
- Attributes
- Methods / operations
Relationships include:
- Association
- Inheritance
- Aggregation
- Composition
- Dependency
Example
For a School Management System:
Student
- Attributes: studentId, name, age
- Methods: registerCourse(), payFees()
Course
- Attributes: courseCode, title, credit
- Methods: assignLecturer()
Relationship:
- One student can register for many courses.
Simple Teaching Sketch
+------------------+
| Student |
+------------------+
| - studentId |
| - name |
| - age |
+------------------+
| + registerCourse()|
| + payFees() |
+------------------+
|
|
v
+------------------+
| Course |
+------------------+
| - courseCode |
| - title |
| - credit |
+------------------+
| + assignLecturer()|
+------------------+
Tips for Students
- Use nouns for class names.
- Use verbs for methods.
- Keep attributes meaningful.
- Do not overload the diagram with too much detail at first.
5) Object Diagram
Purpose
An Object Diagram shows specific instances of classes at a particular moment in time.
When to Use It
Use it when:
- you want to show a real example of class objects,
- you need to explain how class relationships look in a live case,
- you want to illustrate a snapshot of the system.
Importance
- It shows how the class diagram becomes real objects.
- It helps beginners understand class vs object.
How to Draw It
- Use object names like
student1:Student - Underline object names in UML notation
- Show current attribute values
Example
For the School Management System:
john:Studentcs101:Course
john:Student
studentId = 001
name = John
age = 20
cs101:Course
courseCode = CS101
title = Programming I
credit = 3
Difference from Class Diagram
- Class diagram = blueprint
- Object diagram = actual instance at a moment
6) Package Diagram
Purpose
A Package Diagram groups related classes, use cases, or components into packages.
When to Use It
Use it when:
- the system is large,
- you want to organize modules,
- you need to show dependency between groups of elements.
Importance
- Helps manage complexity.
- Useful in large software systems.
- Shows modular architecture.
How to Draw It
- Draw folders or package boxes
- Put related elements inside them
- Show dependencies using arrows
Example
For an E-commerce System:
User ManagementProduct ManagementOrder ManagementPayment Module
This helps show that the system is divided into functional sections.
7) Component Diagram
Purpose
A Component Diagram shows the major software components of a system and how they depend on one another.
When to Use It
Use it when:
- designing system architecture,
- showing software modules,
- explaining deployment-ready software parts,
- working on large applications or enterprise systems.
Importance
- Helps understand system architecture.
- Useful for developers, architects, and DevOps teams.
- Shows reusable and replaceable parts.
How to Draw It
Draw boxes for components such as:
- UI component
- API service
- Authentication service
- Database component
Show dependencies using arrows.
Example
For an Online Banking System:
- Mobile App Component
- Authentication Service
- Transaction Service
- Database Component
Teaching Point
A component diagram answers:
- What are the major software modules?
- How do they connect?
- Which module depends on which?
8) Deployment Diagram
Purpose
A Deployment Diagram shows where software runs physically.
It maps software to hardware or execution environments.
When to Use It
Use it when:
- you want to show infrastructure,
- designing cloud or distributed systems,
- explaining servers, devices, and runtime nodes.
Importance
- Very useful in real-world architecture.
- Helps in cloud deployment planning.
- Shows how software is distributed.
How to Draw It
Use:
- nodes for devices or servers,
- artifacts for deployed software,
- connectors to show communication.
Example
For a Web Application:
- User Phone
- Web Server
- Application Server
- Database Server
Simple Example
[User Phone] ---> [Web Server] ---> [App Server] ---> [Database Server]
Teaching Point
Deployment diagram answers:
- Which device runs which software?
- Where is the database hosted?
- How are systems connected?
9) Composite Structure Diagram
Purpose
Shows the internal structure of a class or component.
When to Use It
Use it when:
- you want to show how parts inside a class or component work together,
- you are modeling complex internals of a system.
Importance
- Useful for advanced architecture.
- Helps when studying internal collaboration of elements.
Example
Inside an OrderService, you may have:
- validation module
- payment handler
- notification handler
This diagram shows their internal interaction.
PART B: BEHAVIORAL UML DIAGRAMS
10) Use Case Diagram
Purpose
A Use Case Diagram shows what the system does from the user’s point of view.
It identifies:
- actors
- use cases
- system boundary
When to Use It
Use it when:
- collecting requirements,
- identifying system users,
- explaining user goals,
- showing system functionality at a high level.
Importance
- Best diagram for requirements analysis.
- Easy for non-technical people to understand.
- Helps define project scope.
Main Elements
- Actor: user or external system
- Use Case: action/function
- System Boundary: the box that contains the system
How to Draw It
- Draw the system boundary as a rectangle.
- Place use cases inside it as ovals.
- Draw actors outside the system.
- Connect actors to use cases with lines.
Example
For a Library System:
Actor: Student
Actor: Librarian
Use cases:
- Borrow Book
- Return Book
- Search Book
- Register Member
Importance
- Identifies key features.
- Helps gather clear requirements.
- Prevents scope confusion.
Teaching Tip
Ask students:
- Who uses the system?
- What do they want to do?
- What external systems interact with it?
11) Sequence Diagram
Purpose
A Sequence Diagram shows how objects interact over time in a particular scenario.
It focuses on the order of messages.
When to Use It
Use it when:
- describing a single use case in detail,
- showing interaction flow,
- explaining method calls or API communication.
Importance
- Helps understand runtime behavior.
- Very useful for system design and debugging.
- Shows the sequence of events clearly.
Main Elements
- Actors/objects
- Lifelines
- Messages
- Activation bars
How to Draw It
- Put participants at the top.
- Draw vertical dashed lifelines.
- Show messages as horizontal arrows.
- Arrange messages in time order from top to bottom.
Example
For Login System:
- User enters username and password.
- UI sends request to Auth Service.
- Auth Service checks database.
- Database returns result.
- Auth Service returns success/failure.
Why It Matters
- Shows control flow.
- Helps developers understand how features work internally.
- Great for APIs, transactions, and user actions.
12) Activity Diagram
Purpose
An Activity Diagram shows workflow, process flow, or business logic.
When to Use It
Use it when:
- modeling a process,
- showing step-by-step business workflows,
- describing decisions and parallel actions.
Importance
- Excellent for business processes.
- Helps explain algorithms or workflows.
- Clear for both technical and non-technical people.
Main Elements
- Start node
- Actions
- Decision nodes
- Merge nodes
- Fork/join
- End node
How to Draw It
- Start with a filled circle.
- Draw actions as rounded rectangles.
- Use arrows for flow.
- Add diamond for decisions.
- End with a bullseye symbol.
Example
For Online Order Process:
- Start
- Select product
- Add to cart
- Checkout
- Pay
- If payment succeeds → confirm order
- If payment fails → retry
Importance
- Good for business process documentation.
- Useful for teaching algorithms.
- Shows branching and parallel execution.
13) State Machine Diagram
Purpose
A State Machine Diagram shows the states of an object and how it changes from one state to another.
When to Use It
Use it when:
- an object has different states,
- behavior changes based on state,
- modeling lifecycle.
Importance
- Helpful for systems with state transitions.
- Useful in embedded systems, UI systems, and order processing.
Example
For an Order:
- New
- Paid
- Shipped
- Delivered
- Cancelled
Transitions:
- New → Paid
- Paid → Shipped
- Shipped → Delivered
- New → Cancelled
How to Draw It
- Use rounded rectangles for states
- Use arrows for transitions
- Show triggers that cause the change
Why It Matters
It explains how an object behaves depending on its condition or stage.
14) Communication Diagram
Purpose
A Communication Diagram shows how objects collaborate and exchange messages.
When to Use It
Use it when:
- you want to focus on object relationships,
- you want to show interaction without a full timeline emphasis,
- you need to show structure and communication together.
Importance
- Alternative to sequence diagram.
- Good for showing object collaboration.
Example
For order processing:
- Customer
- OrderService
- PaymentService
- Database
Messages flow between them in numbered order.
15) Timing Diagram
Purpose
A Timing Diagram shows how the state or condition of an object changes over time.
When to Use It
Use it when:
- timing is very important,
- systems are real-time,
- you need to show delays and durations.
Importance
- Useful in real-time systems, embedded systems, and communication systems.
Example
- Traffic light changes every few seconds
- Sensor data changes over time
- Machine state in industrial automation
16) Interaction Overview Diagram
Purpose
This diagram combines activity diagram flow with interaction diagrams like sequence diagrams.
When to Use It
Use it when:
- a process is too big for one sequence diagram,
- you want to show the high-level flow of multiple interactions.
Importance
- Useful for complex systems.
- Helps show where sub-interactions happen.
PART C: WHICH UML DIAGRAM TO USE AND WHEN
17) Choosing the Right UML Diagram
Use Case Diagram
Use when you want to show:
- system functions,
- users and external actors,
- requirements.
Class Diagram
Use when you want to show:
- structure of data,
- classes and relationships,
- object-oriented design.
Object Diagram
Use when you want to show:
- a snapshot of actual instances.
Sequence Diagram
Use when you want to show:
- message flow in time,
- how a use case happens.
Activity Diagram
Use when you want to show:
- workflow,
- decision-making,
- business process.
State Machine Diagram
Use when you want to show:
- states and transitions of an object.
Component Diagram
Use when you want to show:
- software modules and dependencies.
Deployment Diagram
Use when you want to show:
- physical system architecture,
- servers, devices, cloud nodes.
Package Diagram
Use when you want to show:
- organization of large systems,
- module grouping.
PART D: HOW TO DRAW UML DIAGRAMS WELL
18) General Rules for Drawing UML Diagrams
Start simple
- Do not overcomplicate the first version.
Use the correct symbols
- UML has standard shapes; students should learn them properly.
Keep names clear
- Use meaningful names like
Student,PaymentService,Order.
- Use meaningful names like
Avoid too much text
- UML is visual; keep it readable.
Follow direction and flow
- For behavioral diagrams, arrows matter.
Show relationships correctly
- Do not confuse association, inheritance, and dependency.
Draw from requirements
- First understand the problem, then model it.
Use labels
- Always label actors, processes, and important connections.
PART E: EXAMPLES USING A SINGLE SYSTEM
To make teaching easier, use one example system throughout class.
Example System: Online Food Ordering System
Possible UML diagrams for the same system
Use Case Diagram
Actors:
- Customer
- Restaurant Admin
- Delivery Rider
Use cases:
- Browse Menu
- Place Order
- Make Payment
- Track Order
- Confirm Delivery
Class Diagram
Classes:
- Customer
- Order
- MenuItem
- Payment
- Delivery
Sequence Diagram
Scenario:
- Customer places an order
- System validates cart
- System processes payment
- Restaurant receives order
- Rider gets delivery request
Activity Diagram
Process:
- Open app
- Select food
- Add to cart
- Checkout
- Pay
- Wait for delivery
State Diagram
Order states:
- Created
- Paid
- Preparing
- Out for delivery
- Delivered
- Cancelled
Component Diagram
Components:
- Mobile App
- Order Service
- Payment Service
- Notification Service
- Database
Deployment Diagram
Nodes:
- Customer Phone
- Restaurant Tablet
- Server
- Cloud Database
- SMS Gateway
PART F: TEACHING IMPORTANCE OF UML DIAGRAMS
UML diagrams are important because they help students:
- think before coding,
- understand software architecture,
- communicate system design,
- document projects,
- prepare for real software development,
- build stronger analysis and design skills.
In exams and projects, students often lose marks not because their idea is bad, but because they cannot show the system clearly. UML solves that problem.
PART G: COMMON MISTAKES STUDENTS MAKE
- Mixing up class diagram and object diagram
- Drawing use case diagrams like flowcharts
- Putting methods inside use case ovals
- Forgetting the system boundary
- Using arrows incorrectly
- Showing too much detail too early
- Confusing sequence diagrams with activity diagrams
- Not labeling actors or classes clearly
- Drawing unreadable diagrams
- Using UML without understanding the problem
PART H: STUDENT ASSIGNMENT
Assignment Title
Design UML Diagrams for a Real-World System
Objective
Students should demonstrate understanding of UML diagrams by modeling a system using multiple diagram types.
Instructions
Choose one system from the list below: > 1. Hospital Appointment System 2. School Fee Payment System 3. Bus Tracking System 4. Online Shopping System 5. Library Management System 6. Farm Produce Market Information System
Required Diagrams
Students must draw and explain:
- Use Case Diagram
- Class Diagram
- Sequence Diagram
- Activity Diagram
- State Machine Diagram
- Component Diagram
- Deployment Diagram
Alternatively you can design a system for your Capstone project
For Each Diagram, Students Must Include:
- title,
- purpose,
- clear symbols,
- correct relationships,
- short explanation of what the diagram shows.
Assignment Questions
Part A: System Understanding
- What problem does your chosen system solve?
- Who are the users of the system?
- What are the main features of the system?
Part B: UML Modeling
- Draw the Use Case Diagram.
- Draw the Class Diagram.
- Draw the Sequence Diagram for one important use case.
- Draw the Activity Diagram for one process.
- Draw the State Machine Diagram for one object.
- Draw the Component Diagram.
- Draw the Deployment Diagram.
Part C: Reflection
- Which diagram was easiest to draw and why?
- Which diagram was hardest to draw and why?
- Why is UML important before coding?
PART I: EXTRA CLASSROOM EXERCISE
In-Class Exercise
Ask students to design UML diagrams for:
A university course registration system
Actors
- Student
- Lecturer
- Registrar
- Admin
Use Cases
- Register Course
- Add/Drop Course
- Approve Registration
- View Timetable
- Generate Result
Suggested Class Ideas
- Student
- Course
- Lecturer
- Registration
- Department
This is a good exercise because it is familiar and easy to visualize.
PART J: SUMMARY FOR STUDENTS
UML helps us:
- understand a system,
- design before coding,
- communicate clearly,
- organize software,
- reduce mistakes.
The most important diagrams to master first are:
- Use Case Diagram
- Class Diagram
- Sequence Diagram
- Activity Diagram
- State Machine Diagram
- Component Diagram
- Deployment Diagram