π Object Diagram, Component Diagram, and Deployment Diagram (OOAD)
These are UML structural diagrams used to show different views of a system.
π· 1. Object Diagram
πΉ Definition
An Object Diagram is a snapshot of a system at a specific point in time, showing:
- Objects (instances of classes)
- Their attributes (current values)
- Relationships between objects
π Simple idea:
It shows real objects in action at a particular moment.
πΉ Key Points β
- Derived from class diagrams
- Represents runtime snapshot
- Focuses on actual instances, not classes
πΉ Notation
objectName : ClassName
-----------------------
attribute = value
πΉ Example (Library System)
book1 : Book
----------------
title = "OOAD"
author = "UML"
member1 : Member
----------------
name = "Ali"
πΉ Use Case
- Debugging system behavior
- Understanding object interactions
- Testing design logic
πΉ Advantage
- Easy to visualize real system state
- Helps in debugging
π· 2. Component Diagram
πΉ Definition
A Component Diagram shows the organization and dependencies of software components in a system.
π Simple idea:
It shows how a system is built using modules (components).
πΉ Key Points β
- Focuses on physical software structure
- Used in implementation phase
- Shows code-level organization
πΉ Components Examples
- Database module
- UI module
- Authentication module
πΉ Notation
+----------------------+
| Component Name |
|----------------------|
| Provided Interface |
| Required Interface |
+----------------------+
πΉ Example (Online System)
[User Interface] β [Business Logic] β [Database]
πΉ Interfaces
| Type |
Meaning |
| Provided |
Services offered |
| Required |
Services needed |
πΉ Advantage
- Improves modularity
- Easy maintenance
- Supports reuse
π· 3. Deployment Diagram
πΉ Definition
A Deployment Diagram shows how software is physically deployed on hardware nodes.
π Simple idea:
It shows where software runs in real world machines/servers.
πΉ Key Points β
- Focuses on hardware + software mapping
- Used in system deployment phase
- Shows runtime environment
πΉ Components
| Element |
Description |
| Node |
Hardware device (server, PC) |
| Artifact |
Software files (code, app) |
| Connection |
Network link |
πΉ Notation
[Server]
|
[Client PC]
πΉ Example (Web System)
Client Browser β Web Server β Database Server
πΉ Real Deployment Example
- Mobile App β Phone
- Backend β Cloud Server
- Database β Database Server
πΉ Advantage
- Shows system architecture
- Helps in network planning
- Useful for distributed systems
π· 4. Comparison of All Three Diagrams β
| Feature |
Object Diagram |
Component Diagram |
Deployment Diagram |
| Focus |
Objects |
Software modules |
Hardware + software |
| Level |
Runtime snapshot |
Design/implementation |
Physical deployment |
| Shows |
Instances |
Components |
Nodes (machines) |
| Purpose |
Debugging |
System structure |
System installation |
π· 5. Key Differences in Simple Words
- Object Diagram β "What exists now"
- Component Diagram β "How system is built"
- Deployment Diagram β "Where system runs"
π· 6. Likely Exam Questions
- Define object diagram.
- What is a component diagram?
- Explain deployment diagram.
- Difference between object and class diagram.
- Draw component diagram of a system.
- What are nodes in deployment diagram?
- Explain real-life use of object diagram.
- What is an artifact in deployment diagram?
- Compare all three diagrams.
- Advantages of component diagrams.
π· 7. Quick Revision Summary π§
πΉ Object Diagram
- Snapshot of real objects
- Shows instances at a moment
πΉ Component Diagram
- Shows software modules
- Focus on system structure
πΉ Deployment Diagram
- Shows hardware + software mapping
- Focus on physical execution
π Easy Trick:
"OCD β Objects, Components, Deployment"