All You Need to Know About UML Diagrams

Vicky’s Notes
Javarevisited
Published in
5 min readDec 17, 2019

--

The two types of Data Modeling Techniques are:

  1. Entity Relationship (E-R) Model
  2. UML (Unified Modelling Language)
https://github.com/vicky-playground/resume

This post will focus on UML only. Key areas will be covered:

1. What is UML2. What’s the Difference Between Structural Diagrams and Behavioral Diagrams3. Class Diagram4. Object Diagram5. Component Diagram6. Use Case Diagram7. Activity Diagram

UML, short for Unified Modeling Language, is like a blueprint(or a design plan) for visualizing a software modeling using a collection of diagrams. It not only makes you evaluate the whole concept thoroughly but also makes sure everyone on the team is on the same page. UML diagram is also one of the popular techniques of Business Process Modeling. It is an object-oriented representation chart describing the relationship between the “actors” and “systems”. There are different types of UML such as use case diagrams, sequence diagrams, communication diagrams, and so on.

UML diagrams can be organized into two distinct group.

Structural vs Behavioral Diagrams

The structural diagrams depict the static aspects of the system, which represent those parts of a diagram forming the main structure and therefore stable.

The behavioral diagrams show how the system works ‘in motion’, that is how the system interacts with external entities and users, how it responds to input or event and what constraints it operates under.

Class Diagram - the Bird’s Eye View of a System

Class diagrams are the most important UML diagrams used for software application development. A class diagram describes the types of objects in the system and the different kinds of relationships that exist among them.

Class Diagram Example 1
Class Diagram Example 2

As you can tell from the pictures above, the essential elements of the UML class diagram are:

  1. Class Name (should always be written in bold format)
  2. Attributes
  3. Operations (Methods)

Object Diagram — an Instance of a Class Diagram

An object diagram can be considered a unique case of the class diagram which is the snapshot of the detailed state of a system during a point in time. It could contain data values of objects inside the structure at some point in time. Because it displays instances instead of classes, it is also known as an instance diagram. The differences between class diagrams and object diagram are in the purpose, and what they show at a specific time.

Object Diagram Example 1
Object Diagram Example 2

Component Diagram — Model Implementation Details

Component diagrams visualize the implementation view of a system.

Component Diagram Example

There are two types of component interfaces: provided interface and required interface.

Provided Interface

An entity that is called from others and provides services.

Required Interface

An entity that calls and uses other’s services.

Port

It can be used as an “access point” to connect provided interfaces and required interfaces together.

Use Case Diagram—Model the Functionality

As the most known diagram type of the behavioral UML types, Use case diagrams to describe the behavior of a system from the user’s point of view. Use case diagrams consist of four objects.

  1. Actor: people or things that interact with the system’s use cases
  2. Use case: specific pieces of the system’s functionality
  3. System: defines what functionality is included within the system
  4. Package: optional to represent the ownership of a use case
Use Case Diagram Example

Use Case Specification

A use case is like a story to tell the scenario of what happens when a user starts to engage with a system. You can’t share the right story if you don’t prepare some main points in advance. That’s why use case specification comes in! Here is the standard use case template for recording the detailed information for the use cases.

Use Case Spec.

Extend Relationship Between Two Use Cases

As the name implies it extends the base use case and adds more functionality to the system.

Include Relationship Between Two Use Cases

The main purpose is to reuse common actions across multiple use cases.

Activity Diagram — Modeling the Flow

Activity diagrams illustrate the workflow of any component in a graphical way and describe the steps involved in the execution of a use case instead of implementation.

Activity Diagram Example

✍️

Since 👏 is free of charge, I’d like to make 👏 as one of our communication channels.😍 P.S. Holding on clicking the 👏 without lifting your finger can clap in a row.
😉If you just like this story, please reward me 1–3 👏.
😉If you happen to be interested in this kind of stories, please reward me 4–6 👏.
😉If you are following me and looking forward to my visit to your story too, please give me 10👏 to let me know️ ❤ ️

--

--

Vicky’s Notes
Javarevisited

An IT enthusiast driven by the belief that success is not just about personal achievement but inspiring others to excel.