Structural UML Diagrams: Types, Notation and a Worked Model

Learn to read structural UML by building a course-platform class model, testing an exact object snapshot and checking every multiplicity and relationship.

KnowledgeGate Team

Exam prep & CS education

Updated 26 Nov 20266 min read
Structural UML Diagrams: Types, Notation and a Worked Model

Structural UML separates diagram types by the question they answer. A course-platform model makes the notation concrete, from class boxes and multiplicities to an object snapshot whose values agree. Use multiplicity to test the model instead of identifying symbols by memory.

1. Structural UML diagrams show what exists

A structural UML diagram gives a static view of elements and the relationships among them. A behavioural diagram asks what happens over time. For example, a class diagram can show that a Course contains Lesson objects, while a sequence or activity diagram can show the order in which a learner opens and completes a lesson.

Structural diagram

Main question it answers

Class

What types, attributes and relationships exist?

Object

What does one instance snapshot contain?

Package

How are elements grouped, and what depends on what?

Component

Which modular software units and interfaces exist?

Composite structure

What parts, ports and connectors are inside a classifier?

Deployment

Where do software artifacts run?

Profile

Which domain-specific stereotypes and tagged values extend UML?

These are alternative views, not seven diagrams that every design must include. The Object Oriented Technology explanation provides useful background on classes, objects and OOP pillars. For a library checkout carried across class, sequence and state views, see Modelling and UML fundamentals with a worked library example; the focus here is structural diagram taxonomy and a course-platform class/object model.

2. Read class-diagram notation before drawing

A class box can have three compartments. The first contains the class name, the second contains attributes such as courseId: String, and the third contains operations such as lessonCount(): int. A + marks public visibility, - marks private visibility, and # marks protected visibility.

Relationships need both a line style and an endpoint symbol:

  • An association is a solid line. A dependency is a dashed arrow.

  • Generalisation is a solid line with a hollow triangle pointing to the parent. It represents inheritance.

  • Realisation is a dashed line with a hollow triangle.

  • Aggregation puts a hollow diamond at the whole. Composition puts a filled diamond at the lifecycle-owning whole.

Multiplicities include 1, 0..1, 0..* and 1..*. The number near one end tells you how many instances at that end can relate to one instance at the opposite end. Generalisation maps to inheritance because the child type specialises the parent. For the code-level next step, the Java Programming course develops the same ideas without requiring us to turn this model into full Java source.

3. Build the course-platform class diagram

Begin with nouns, then decide what each noun knows and does. Our six classifiers are:

  • Learner: learnerId: String, name: String, enrol(course: Course): Enrollment

  • Course: courseId: String, title: String, lessonCount(): int

  • abstract Lesson: lessonId: String, title: String, durationMin: int, open(): void

  • VideoLesson: videoUrl: String

  • QuizLesson: maxMarks: int

  • Enrollment: enrollmentId: String, enrolledOn: Date, completedLessons: int, progress(totalLessons: int): double

Now add the relationships. Course "1" *-- "1..*" Lesson has a filled diamond at Course. Each course owns at least one lesson, and each lesson belongs to exactly one course. VideoLesson --|> Lesson and QuizLesson --|> Lesson point their hollow triangles towards the abstract parent.

A learner can join many courses, and a course can have many learners. The relationship also needs its own values, including enrolledOn and completedLessons, so it deserves the separate Enrollment class. Draw Learner "1" -- "0..*" Enrollment and Course "1" -- "0..*" Enrollment. Every enrollment links to exactly one learner and exactly one course.

The modelling order is reusable: nouns suggest candidate classes, values suggest attributes, responsibilities suggest operations, and lifecycle ownership can justify composition. A relationship with meaningful data can become a class. A hollow aggregation diamond is not suitable here because the model says that a course controls the membership of its lessons.

UML class diagram linking Learner, Enrollment and Course, with composed Lesson subclasses VideoLesson and QuizLesson and labeled multiplicities.

4. Validate the model with an object snapshot

Create asha:Learner {learnerId = "L101", name = "Asha"}, oop:Course {courseId = "C42", title = "OOP Foundations"} and e9001:Enrollment {enrollmentId = "E9001", enrolledOn = "2026-08-01", completedLessons = 2}. Link e9001 to exactly asha and oop.

Course oop composes five lessons: v1:VideoLesson {lessonId = "LS1", title = "Classes and Objects", durationMin = 18, videoUrl = "vid/ls1"}; v2:VideoLesson {lessonId = "LS2", title = "Inheritance", durationMin = 24, videoUrl = "vid/ls2"}; v3:VideoLesson {lessonId = "LS3", title = "Polymorphism", durationMin = 21, videoUrl = "vid/ls3"}; q1:QuizLesson {lessonId = "LS4", title = "UML Check", durationMin = 10, maxMarks = 20}; and v4:VideoLesson {lessonId = "LS5", title = "Refactoring", durationMin = 16, videoUrl = "vid/ls5"}.

Five lessons satisfy 1..*. One enrollment satisfies 0..*, each lesson has one owning course, and progress is 2 / 5 x 100 = 40%. If a sixth lesson were added, the same completed count would give 2 / 6 x 100 = 33.3%, rounded to one decimal place.

Correct UML object snapshot for Asha's OOP Foundations enrollment and five composed lessons, with 40% progress.

5. Choose another view when the question changes

The same platform can be viewed at other levels. A package diagram can group ui, domain and persistence. A component diagram can connect WebApp, CourseAPI and VideoService through interfaces. A composite structure diagram can expose controls, renderer and progressTracker inside CoursePlayer.

A deployment diagram can place the web bundle on a browser node, CourseAPI on an application node and the schema on a database node. A profile can add a <<service>> stereotype for the team's modelling rules.

Use class diagrams for type structure, object diagrams for populated snapshots, packages for namespace organisation, components for replaceable modules and interfaces, composite structures for one classifier's internals, deployment for runtime placement, and profiles only when extending UML vocabulary. A broader software-design workflow shows how such views support a coherent design.

6. Avoid notation traps

Reversed multiplicity: Course 1 beside the Course end and Lesson 1..* beside the Lesson end means one course owns one or more lessons. Read each label from the opposite object.

Diamond guessing: composition is not simply a stronger-looking association. The filled diamond belongs at Course because lessons are owned parts under this model's lifecycle rule. Do not put it at Lesson, and do not use a hollow diamond without a distinct shared-whole meaning.

Classifier versus instance: Course is a class box. An underlined oop:Course is an object.

Generalisation versus realisation: a hollow triangle is not enough to identify the relationship. A solid line means generalisation, while a dashed line means realisation.

Static versus dynamic claims: an object diagram can show that E9001 exists. It cannot prove that enrolment must occur before lesson playback. Order needs a behavioural diagram.

7. Turn notation into short reasoning checks

Practice questions on Structural UML Diagrams turn these checks into exam-style reasoning tasks: identify endpoints, read multiplicities, and inspect line style before naming the relationship.

  1. If three Course objects each use composition multiplicity 1..*, the minimum number of Lesson objects is 3. Each course needs at least one, so 3 x 1 = 3, and a composed lesson has one owner.

  2. Under Learner 1 -- 0..3 Loan, one learner linked to four open loan objects violates the upper bound because 4 > 3. Three open loans are valid because 3 <= 3.

  3. A solid line from VideoLesson to a hollow triangle at Lesson is generalisation. Changing that line to dashed would make it realisation.

For each check, identify the endpoints, read multiplicities from the opposite object, inspect the line style, and only then inspect the diamond or triangle. Show the reasoning before naming the symbol.

8. The short version and next study step

Use a five-part checklist: name the view's question; distinguish a class from an object; read the line style and arrowhead; read multiplicities from the opposite end; and test every snapshot against ownership and count constraints. In our model, C42 owns five lessons, E9001 links one learner to one course, and 2 / 5 completed gives 40%.

For a structured GATE CS route, continue with GATE Guidance by Sanchit Sir. For a broader programming pathway, explore the Coding & Skills catalogue.