codingstuff.io
ExploreTutorialsProblemsCS Subjects
Get Started
ExploreTutorialsProblemsCS Subjects
Get Started
codingstuff.io

Master the art of building software through interactive tutorials, real-world problems, and guided projects.

Pune, Maharashtra, India

codingstuffmail@gmail.com

Product

  • Explore
  • Tutorials
  • Problems
  • CS Subjects

Company

  • About
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Sitemap

© 2026 codingstuff.io. All rights reserved.

Built with ❤️ for developers everywhere

/
/
All Subjects
🧩

OOP Concepts

23 chapters

1Procedural vs Object-Oriented2Classes, Objects, & Instantiation3Constructors & Destructors4Static Members & Methods5Encapsulation & Access Modifiers6Data Abstraction7Inheritance Types (Single, Multiple)8Compile-Time Polymorphism (Overloading)9Polymorphism & Interfaces10Run-Time Polymorphism (Overriding)11Virtual Functions & V-Tables12Interfaces & Abstract Classes13Generic Programming (Templates & Generics)14Exception Handling in OOP15SOLID Design Principles16Composition over Inheritance17Coupling & Cohesion18UML Diagrams Basics19Creational Patterns (Singleton, Factory)20Structural Patterns (Adapter, Decorator)21Behavioral Patterns (Observer, Strategy)22MVC Architecture Pattern23Object Serialization & Cloning
SubjectsOOP Concepts

UML Diagrams Basics

Updated 2026-05-03
2 min read

UML Diagrams Basics

UML (Unified Modeling Language) is a standardized visual language for specifying, constructing, and documenting the artifacts of software systems. It provides a common vocabulary for developers to communicate design decisions.

1. Class Diagram (Most Important)

The Class Diagram shows the static structure of a system: classes, their attributes, methods, and relationships.

A class is drawn as a rectangle with three compartments:

  1. Class Name (top)
  2. Attributes (middle) — Format: visibility name: type
  3. Methods (bottom) — Format: visibility name(params): returnType

Visibility Symbols:

  • + Public
  • - Private
  • # Protected
  • ~ Package

Relationships:

  • Association: A general connection between two classes. Drawn as a solid line. Example: Student is associated with Course.
  • Aggregation (Has-A, weak): A whole-part relationship where parts can exist independently. Drawn as a hollow diamond. Example: Department has Professors, but professors exist without the department.
  • Composition (Has-A, strong): A whole-part relationship where parts cannot exist without the whole. Drawn as a filled diamond. Example: House has Rooms. Rooms don't exist without the house.
  • Inheritance (Is-A): Drawn as a solid line with a hollow triangle arrowhead. Example: Dog inherits from Animal.
  • Implementation: A class implements an interface. Drawn as a dashed line with a hollow triangle.
  • Dependency: A class temporarily uses another. Drawn as a dashed arrow.

2. Use Case Diagram

Shows the functional requirements of a system from the user's perspective. Contains:

  • Actors (stick figures): External entities that interact with the system (User, Admin).
  • Use Cases (ovals): Actions the system performs (Login, Place Order, Generate Report).
  • System Boundary: A rectangle enclosing the use cases.

3. Sequence Diagram

Shows the interaction between objects over time. Objects are at the top with vertical dashed lifelines. Horizontal arrows represent messages exchanged between objects in chronological order (top to bottom).

4. Activity Diagram

A flowchart-like diagram showing the flow of control from activity to activity. Used to model business processes and workflow logic. Contains start/end nodes, activities (rounded rectangles), decision diamonds, and fork/join bars for parallel activities.



PreviousCoupling & CohesionNextCreational Patterns (Singleton, Factory)

Recommended Gear

Coupling & CohesionCreational Patterns (Singleton, Factory)