Skip to content
Dev Dump

UML Design

  • UML stands for Unified Modeling Language.

  • It is used for Object-Oriented Analysis and Design (OOAD).

  • Helps to visualize, specify, construct, and document software systems.

  • UML consists of 13+ diagrams, categorized as:

    • Structural Diagrams (e.g., Class Diagram, Component Diagram)

    • Behavioral Diagrams (e.g., Use Case, Sequence Diagram)

UML diagram types

  • A Class Diagram represents the static structure of a system.

  • It models classes, their attributes, methods, and relationships between them.

ElementDescription
ClassBlueprint for objects
AttributeProperties or data members
MethodFunctions or operations of class
RelationshipsAssociation, Aggregation, Composition, Inheritance
  • Helps in designing and understanding object-oriented systems.

  • Directly maps to OOP code (Java, C++, etc.).

Class diagram example

“Has-a” relationship where lifetime is tightly bound.

  • One class owns another completely.

  • Child object cannot exist independently.

  • Represented using filled diamond.

Composition relationship

“Has-a” relationship but with independent lifecycle.

  • One class contains another, but child can exist independently.

  • Represented using hollow diamond.

Aggregation relationship

One class knows about another.

  • Interaction flows in one direction only.

  • Represented using a simple arrow.

Unidirectional association

Two classes are mutually aware.

  • Both classes can interact with each other.

  • Represented using a line without arrows.

Bidirectional association