# Diagramming: an overview

Sketch a program before you build it with three kinds of diagram, a flowchart, a UML class diagram and an entity-relationship diagram, on paper or in a free tool.

Novice · Software Development · Updated November 14, 2026

By Gregor Dzierzon

## After this lesson you can

- Choose a flowchart, a UML class diagram or an ERD for what you need to show
- Follow a flowchart's steps and decisions to find what happens for a given input

## Key takeaways

- A diagram lets you check a plan, and share it, before you have written any code.
- A flowchart shows the steps and decisions of a process. A decision is a diamond, and each arrow out of it is one answer.
- A UML class diagram shows a program's classes, the data and actions in each, and how they are connected.
- An entity-relationship diagram (ERD) shows a database's tables, their columns, and how the tables link together.
- Paper is fine. Lucidchart and draw.io are free tools for diagrams you want to keep or share.

Before you put together a bookshelf, you look at the picture on the instructions to see where every piece goes. Software works the same way. A quick drawing of how a program should work lets you spot a missing step, and show your plan to someone else, before you have written a line of code.

Developers use many kinds of diagram. This lesson shows the three you will meet first in this course, and how to read each one.

## Flowcharts: the steps and decisions

A **flowchart** shows a process as boxes joined by arrows. You start at the top or the left and follow the arrows. Each shape has a job:

| Shape | What it means |
|---|---|
| Oval | Where the process starts or ends |
| Rectangle | A step: something the program does |
| Diamond | A decision: a question with two or more answers. Each arrow out of it is labeled with one answer. |
| Parallelogram | Data going in or out, such as loading a saved profile |

Here is a flowchart for signing in to a website:

![A flowchart of signing in: the user enters a username and password; invalid credentials show an error and loop back, valid ones show a welcome message and load the profile](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/09/2afe779d8f784594b702643947611e23.png)

Follow it with a wrong password. At the diamond, *Validate Credentials*, take the arrow labeled **Invalid**: the program shows an error message, and the arrow takes you back to typing your username and password. With the right password, you take the **Valid** arrow instead: a welcome message, then your profile loads, and the process ends.

A flowchart doesn't care which language you write the program in. The same flowchart can be built in Java, C# or any other language.

**Try it.** On paper, draw a flowchart for buying a coffee: start, order, a decision *Is there enough money on the card?*, and two paths, one that hands over the coffee and one that asks for another card. Label both arrows out of the diamond.

## UML class diagrams: the parts of a program

**UML** (Unified Modeling Language) is a standard set of diagrams for describing software. The one you will use most is the **class diagram**. Later in the course you will write programs out of **classes**: each class is one kind of thing the program works with, such as a card or a deck of cards.

In a class diagram, each class is a box with three parts: its name at the top, the data it holds in the middle, and the actions it can do at the bottom. Lines between the boxes show how the classes are connected. Here, a game has a deck and players' hands, and both the deck and each hand hold cards:

![A UML class diagram of a card game: a Game has a Deck and Hands, and a Deck and a Hand each hold Cards, with each class's fields and methods listed](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/886e3524228a4ed1aca1f15e6b79e9ff.webp)

You don't need to read every line of it yet. For now, notice that you can see the whole program's shape on one page. UML has other diagrams too, such as sequence diagrams and use case diagrams, which you will meet later.

## Entity-relationship diagrams: the data

An **entity-relationship diagram** (ERD) shows a database: each table is a box listing its columns, and lines show how the tables link together. Here is the database for a gym's class schedule:

![An ERD of a gym's class schedule: customers and classes are joined through customer_classes, and each class has one teacher, with primary and foreign keys marked](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/09/6f3b4cd7ced247e591bab4660681ef66.png)

The marks at the ends of a line say how many: a line that splits into three (a "crow's foot") means *many*. Here one customer can sign up for many classes, and one class can have many customers. You will design databases like this one in the database chapters.

## Which diagram fits?

Ask what you want to show:

- **How something happens, step by step**, with its decisions: a flowchart.
- **What a program is made of**, and how its parts connect: a UML class diagram.
- **What data you store**, and how the tables link: an ERD.

## Tools for drawing

A pencil and paper, or a whiteboard, is a fine place to start. When you want a diagram you can keep, change and share, use a tool:

- [Lucidchart](https://www.lucidchart.com) runs in your web browser. Its free plan is enough for small diagrams, and teams use it to share diagrams.
- [draw.io](https://www.drawio.com) (also called diagrams.net) is free and open source. It runs in your web browser or as a desktop app, and an extension lets you draw in VS Code.

Both have ready-made shapes for flowcharts, UML and ERDs.

## Check yourself

2 questions to try on the lesson page.

## So what

Ten minutes with a diagram can save hours of rewriting code. A flowchart checks the steps, a class diagram the parts, and an ERD the data, and each one gives you something to show before you build.

## Key terms

- [Flowchart](https://www.ask-codey.com/glossary/flowchart)
- [Unified Modeling Language (UML)](https://www.ask-codey.com/glossary/unified-modeling-language-uml)
- [UML Class Diagram](https://www.ask-codey.com/glossary/uml-class-diagram)
- [Entity-Relationship Diagram (ERD)](https://www.ask-codey.com/glossary/entity-relationship-diagram-erd)

## Cheat sheets

- [Diagramming: an overview](https://www.ask-codey.com/cheat-sheets/diagramming-an-overview-cheat-sheet)

Source: https://www.ask-codey.com/lessons/diagramming-an-overview
