Skip to main content

Object Diagram

It shows a snapshot of the objects at a particular point in time, their states, and their relationships. Similar to class diagrams, but shows actual instances (objects) rather than class definitions.

Syntax:

+------------------------+
| objectName : ClassName |
+------------------------+
| attributes = value |
+------------------------+

Example:

+-----------------+           +------------------+
| Library1 | | Member1: John |
+-----------------+ +------------------+
| name: CityLib | | name: John Doe |
| address: City A | | membershipId: 123 |
+-----------------+ +------------------+
Library1 has Member1 (object relationship)