Software UML Samples

Login Sequence DiagramsoftwareBrowser, web app, auth service and user DB exchanging messages for a successful and a failed login. E-Commerce Class DiagramsoftwareCustomer, Order, OrderLine, Product and an abstract Payment hierarchy with multiplicities. Order State MachinesoftwareThe full order lifecycle with payment retries, timeout, fulfilment substates, cancel, return and refund. CI/CD Activity DiagramsoftwareA pipeline in swimlanes from commit through parallel tests, staging, approval, canary and rollback. Microservices Component DiagramsoftwareAn API gateway and six services wired by provided and required interfaces. Web App Deployment DiagramsoftwareCDN, load balancer, three app nodes and a PostgreSQL primary with a streaming replica. Online Shop Use Case DiagramsoftwareCustomer, admin and payment provider goals with include and extend relationships.

This section holds complete, realistic UML diagrams for everyday software work. Every page takes one scenario from an online shop or its delivery pipeline and draws it with one UML diagram type, then explains how to read it, shows a variant, weighs pros and cons, and gives the same diagram as Mermaid or PlantUML text.

UML (Unified Modeling Language, version 2.5) has two families of diagrams. Structure diagrams describe what a system is made of: classes, components and the machines they run on. Behaviour diagrams describe what it does: the goals users reach, the steps of a process, the lifecycle of one object and the messages exchanged in one request. Software teams use both, because a design is only clear once the parts and the way they interact are both on paper.

You rarely need all seven diagrams for one project. Pick the one that answers the question in front of you; the table below is a quick guide.

Which Diagram for Which Question

Seven diagrams in two families Structure: what the system is made of Behaviour: what the system does Class diagram types and relationships Component diagram services and interfaces Deployment diagram nodes and network links Use case diagram actors and goals Activity diagram steps, branches, lanes State machine diagram lifecycle of one object Sequence diagram messages in time order Start from goals (use case), then structure, then behaviour where order or state matters.
QuestionDiagramSample page
Who uses the system, and for what?Use caseOnline Shop Use Case Diagram
What are the core types and how do they relate?ClassE-Commerce Class Diagram
Which parts exist and what do they depend on?ComponentMicroservices Component Diagram
Where does it run and how is it connected?DeploymentWeb App Deployment Diagram
Who calls whom, in what order?SequenceLogin Sequence Diagram
What states can one object be in?State machineOrder State Machine
What are the steps, branches and hand-offs?ActivityCI/CD Activity Diagram

How to Use These Samples

All samples describe the same imaginary shop, so you can read them as one design. The use case diagram sets the scope. The class diagram names the core types. The component and deployment diagrams show how the code is split into services and where those services run. The sequence, state machine and activity diagrams then zoom into behaviour: a login request, the life of one order, and the pipeline that ships every change.

Each diagram is hand-drawn SVG that follows standard UML notation. Colours are only emphasis: blue for normal elements, yellow for the highlighted element, green for success paths and red for error paths. UML itself is colour-free, so you can copy any of these into a whiteboard or a tool without losing meaning.

For the notation rules behind each diagram, see the UML diagram reference; each sample page links to its own reference page.