Object Diagram Examples & Templates

Object diagrams show a snapshot of objects and their relationships at a specific point in time, providing concrete examples of class diagram instances.

When to Use Object Diagrams

Use object diagrams to illustrate specific scenarios, show example data structures, document test cases, and clarify complex class relationships.

Common Use Cases:

  • Example data structures
  • System state snapshots
  • Test case scenarios
  • Configuration examples
  • Relationship illustrations

Featured Object Diagram Examples

Explore 3 real-world object diagram examples with detailed explanations and PlantUML source code.

Social Media: A User's Post with CommentsSocial Media: A User's Post with Commentspost42id = 42author = user_alexcontent = "Loving the new design!"timestamp = "2024-09-18 14:30:00"likes_count = 2comments_count = 1user_alexid = 101username = "Alex"display_name = "Alex Johnson"email = "alex@example.com"profile_picture = "alex_avatar.jpg"user_brianid = 102username = "Brian"display_name = "Brian Smith"email = "brian@example.com"profile_picture = "brian_avatar.jpg"user_cathyid = 103username = "Cathy"display_name = "Cathy Wilson"email = "cathy@example.com"profile_picture = "cathy_avatar.jpg"like1id = 201post_id = 42given_by = user_briantimestamp = "2024-09-18 14:45:00"reaction_type = "thumbs_up"like2id = 202post_id = 42given_by = user_cathytimestamp = "2024-09-18 15:12:00"reaction_type = "heart"comment1id = 301post_id = 42author = user_briantext = "Looks great!"timestamp = "2024-09-18 14:50:00"likes_count = 0Main post object containingcontent and metadataPost author withprofile informationLike reactions fromdifferent usersUser comments onthe post contentauthored byhas likeshas commentsgiven bygiven bywritten by

Social Media: A User's Post with Comments

Object diagram showing a specific post on a social media feed with its associated likes and comments, demonstrating the relationships between users, posts, and engagement interactions.

View Example
Music Streaming: A User's PlaylistMusic Streaming: A User's Playlistplaylist_chillid = "pl_001"name = "Chill Vibes"creator = user_samcreated_date = "2024-09-15"last_modified = "2024-09-18"track_count = 3total_duration = "20:45"is_public = truedescription = "Perfect songs for relaxing"user_samid = "usr_456"username = "Sam"display_name = "Sam Rodriguez"email = "sam@example.com"subscription_type = "Premium"country = "US"join_date = "2023-03-12"track1id = "trk_101"title = "Bohemian Rhapsody"artist = "Queen"album = "A Night at the Opera"duration = "5:55"release_year = 1975genre = "Rock"position_in_playlist = 1added_date = "2024-09-15"track2id = "trk_102"title = "Stairway to Heaven"artist = "Led Zeppelin"album = "Led Zeppelin IV"duration = "8:02"release_year = 1971genre = "Rock"position_in_playlist = 2added_date = "2024-09-16"track3id = "trk_103"title = "Hotel California"artist = "Eagles"album = "Hotel California"duration = "6:48"release_year = 1976genre = "Rock"position_in_playlist = 3added_date = "2024-09-18"artist_queenid = "art_201"name = "Queen"formed_year = 1970country = "UK"genre = "Rock"active = falseartist_led_zeppelinid = "art_202"name = "Led Zeppelin"formed_year = 1968country = "UK"genre = "Rock"active = falseartist_eaglesid = "art_203"name = "Eagles"formed_year = 1971country = "US"genre = "Rock"active = trueUser's custom playlistwith metadata and settingsPlaylist creator withsubscription detailsOrdered track listwith position metadataArtist informationfor track attributioncreated bycontains (position 1)contains (position 2)contains (position 3)performed byperformed byperformed by

Music Streaming: A User's Playlist

Object diagram representing a user's custom playlist in a music streaming service, showing relationships between users, playlists, tracks, and artists in a digital music ecosystem.

View Example
University Management: A Student Enrolled in a CourseUniversity Management: A Student Enrolled in a CoursestudentJaneid = "S12345"name = "Jane Smith"email = "jane.smith@university.edu"major = "Computer Science"year = "Sophomore"gpa = 3.7enrollment_date = "2023-08-15"status = "Active"enrollment_CS101id = "ENR_001"student_id = "S12345"course_id = "CS101"enrollment_date = "2024-01-10"semester = "Spring 2024"status = "Enrolled"grade = nullcredits = 3section = "A"course_CS101id = "CS101"name = "Intro to Computer Science"description = "Fundamentals of programming and computer science concepts"credits = 3department = "Computer Science"level = "Undergraduate"max_enrollment = 30current_enrollment = 25meeting_time = "MWF 10:00-10:50"location = "Science Building Room 201"profAlanid = "P456"name = "Alan Turing"title = "Professor"department = "Computer Science"email = "alan.turing@university.edu"office = "CS Building Room 305"office_hours = "Tues/Thurs 2:00-4:00 PM"specialization = "Theoretical Computer Science"hire_date = "2020-09-01"department_CSid = "DEPT_CS"name = "Computer Science"building = "CS Building"head = "Dr. Ada Lovelace"total_faculty = 15total_students = 450established = 1985semester_spring2024id = "SEM_SP24"name = "Spring 2024"start_date = "2024-01-15"end_date = "2024-05-10"registration_deadline = "2024-01-05"status = "Active"total_courses = 120Student entity withacademic informationand enrollment statusBridge entity connectingstudent to course withenrollment detailsCourse offering withschedule and capacityinformationFaculty member responsiblefor course instructionand student guidanceAcademic departmentmanaging coursesand facultyenrolled studentenrolled intaught byoffered bymember ofduring

University Management: A Student Enrolled in a Course

Object diagram illustrating a specific instance of student enrollment in a university course management system, showing relationships between students, courses, professors, and academic departments.

View Example

How to Create Object Diagrams in PlantUML

With Plantdiagrams AI-powered editor, you can create professional object diagrams in seconds. Simply describe what you want to diagram, and our AI will generate the PlantUML code for you.

1

Open the Editor

Start with our free online PlantUML editor - no installation required.

2

Describe Your Diagram

Use our AI assistant to generate object diagram code from natural language.

3

Customize & Export

Edit the diagram with live preview, then export or share with your team.

Need More Examples?

Explore our full gallery of PlantUML diagram examples across all diagram types and industries.