Concept · Intro

How to read these diagrams

Two pictures power every LLD lesson — the class diagram (structure) and the sequence diagram (behaviour). Learn to read both in 5 minutes.

Asked atAmazonGoogleUberAtlassian
step 1 / 13
1/2The class diagram — structure
is-aowns1uses
«interface»
Statement
+ print()
Account
- balance: int
- owner: String
+ withdraw(amt)
+ deposit(amt)
TransactionLog
+ record(txn)
SavingsAccount
+ addInterest()
Notifier
+ send(msg)
The class diagram — structure
1interface Statement { print() }
2 
3class Account implements Statement {
4 - balance: int
5 + withdraw(amt) { ... }
6}
7 
8class SavingsAccount extends Account { }
State
+ / − / #public / private / protected

A class is a box in three parts: the name on top, its private data (−) in the middle, and its public operations (+) at the bottom. Here is Account.