Skip to content

Drawing class designs: outlines and entity sketches

Difficulty: Beginner

Key concepts

  • entity sketch
  • class outline
  • data member
  • member function
  • ownership arrow
  • multiplicity
  • level of detail
  • UML class diagram
  • diagrams as code
  • The two drawings used for class designs on every page of this site: the entity sketch and the class outline, and which question each one answers.
  • What each arrow in a sketch means in C++, and how to read ownership from the types in an outline.
  • How to choose the level of detail for the reader and the question.
  • How to keep drawings from drifting away from the code.
  • How to read a UML class diagram when a book, a team, or an interviewer uses one.

When you design classes, two questions come up again and again:

  1. What exists, and how is it connected? Which classes are there, which one owns which, and which only uses another?
  2. What does each class remember, and what can it do? Its data members and its member functions.

This site answers each with its own drawing.

Drawing Answers Looks like Use it
Entity sketch What exists, and who owns or uses whom Boxes with class names, joined by arrows labelled in words Early, before the members are decided
Class outline What each class remembers and can do One box per class, listing C++ declarations Once the classes are chosen, before or with the code

Neither drawing shows what happens when the program runs: the order of calls, or how an object changes over time. A numbered trace or a sequence diagram shows the order of calls (the next lesson), and a state diagram shows how one object changes (the lesson after).

An entity sketch is a set of boxes, one per class, joined by arrows. Each arrow has a label in words that says how the two classes are connected, and the style of the arrow says whether one owns the other.

Arrow Label examples Means Typical C++ in the class at the tail
solid A --> B “owns”, “owns 0..*”, “stores” B is held inside A and destroyed with A a member object, a container of values, a std::unique_ptr
dashed A -.-> B “knows 1”, “lists 0..*” A remembers B, but does not own it; B must outlive A a reference, a raw pointer, or an ID member
dashed A -.-> B “uses”, “creates”, “notifies” A works with B during a call, but does not store it (or hands it on) a parameter, a local variable, a return value
thick A ==> B “is a”, “implements” A is a kind of B class A : public B

Numbers in a label say how many B’s each A has: “owns 1”, “owns 0..*” (any number, including none), “knows 0..1” (at most one; may be none). When the other direction matters too (how many A’s can share one B), say it in the text, or add a second arrow.

Here is the course catalog from the relationships lesson as an entity sketch.

Entity sketch of the course catalog: a course owns its sessions and assessments, knows its lead, and is listed by departments
Text description of the diagram

Seven boxes. A dashed arrow labelled “lists 0..*” goes from Department to Course: a department lists any number of courses without owning them. A dashed arrow labelled “knows 1 lead” goes from Course to Instructor: each course knows exactly one lead instructor, who must outlive it. Solid arrows labelled “owns 0..*” go from Course to Session and from Course to Assessment: a course holds any number of each and destroys them with itself. Thick arrows labelled “is a” go from Exam to Assessment and from Project to Assessment: both are kinds of assessment.

Diagram source (Mermaid)
flowchart LR
Department -.->|"lists 0..*"| Course
Course -.->|knows 1 lead| Instructor
Course -->|"owns 0..*"| Session
Course -->|"owns 0..*"| Assessment
Exam ==>|is a| Assessment
Project ==>|is a| Assessment

Read it aloud and it is almost a paragraph: “A department lists courses. A course knows its lead instructor, and owns its sessions and assessments. An exam is an assessment, and so is a project.” That is the test of a good sketch: every arrow is a sentence someone who knows the domain can confirm or correct.

Three habits keep sketches useful:

  • One sketch, one question. Draw the five classes involved in a checkout, not all forty in the program.
  • Leave out the standard library. std::vector<Session> is drawn as “owns 0..*” to Session, not as a box called vector.
  • Every arrow must exist in the code (or be planned): an “owns” or “knows” arrow is a data member; a “uses” arrow is a parameter or a local. If you cannot say which member or parameter an arrow is, the arrow is a guess.

A class outline is one plain box per class. Each box lists:

  • the data members, written as C++ declarations (in the outline’s source, these lines start with -);
  • the member functions, also as C++ declarations (lines starting with +);
  • a short note after any line that needs one.

An enum class box lists its values instead. A box labelled interface (abstract class) is a class with only pure virtual functions, which stands for “something that can do this” without saying how.

Here is the same course catalog as an outline. The code it describes is the relationships lesson’s course.hpp:

VerifiedCompiled and tested with GNU 11.4.0 and Clang 14.0.0 (C++20, 2026-12-01).

course.hpp
// One course, such as CS101. It shows three relationships at once:
// - composition: it owns its sessions (by value) and its assessments
// (through unique_ptr), and destroys them when it is destroyed;
// - association: it refers to its lead Instructor through a pointer it
// does not own, so the Instructor must outlive the Course;
// - it can be moved but not copied, because two courses must not own the
// same assessments.
// add_assessment throws std::invalid_argument for a null pointer.
class Course {
public:
// Association: the course refers to its lead, who must outlive it.
// code and title are taken by value and moved into the members (one
// copy at most, made by the caller). `lead_(&lead)` stores the address
// of the instructor: a reference cannot be null, so the pointer is not.
Course(std::string code, std::string title, const Instructor& lead)
: code_(std::move(code)), title_(std::move(title)), lead_(&lead) {}
// Composition through unique_ptr: two courses must never own the same
// assessments, so copying is deleted; moving hands everything over.
// (Deleted explicitly: std::vector<std::unique_ptr<T>> claims to be
// copyable to type traits, and only fails when the copy is compiled.)
Course(const Course&) = delete;
Course& operator=(const Course&) = delete;
// `= default` asks the compiler to write the usual move: each member is
// moved, so the vectors (and the unique_ptrs in them) change hands
// without copying. noexcept promises the move cannot throw.
Course(Course&&) noexcept = default;
Course& operator=(Course&&) noexcept = default;
~Course() = default;
[[nodiscard]] const std::string& code() const noexcept { return code_; }
[[nodiscard]] const std::string& title() const noexcept { return title_; }
// `*lead_` follows the pointer back to the Instructor object itself.
[[nodiscard]] const Instructor& lead() const noexcept { return *lead_; }
// Points the course at a different instructor. Neither instructor is
// created, copied, or destroyed: only the stored address changes.
void change_lead(const Instructor& lead) noexcept { lead_ = &lead; }
// Composition: sessions and assessments are created for this course,
// stored inside it, and destroyed with it.
// The Session is taken by value (the caller's braces build it right
// here) and then moved into the vector, so no second copy is made.
void add_session(Session session) { sessions_.push_back(std::move(session)); }
// Takes ownership of one assessment. The caller passes a unique_ptr
// (usually from std::make_unique), so after the call the course is its
// only owner. Throws std::invalid_argument if the pointer is null.
void add_assessment(std::unique_ptr<Assessment> assessment);
[[nodiscard]] const std::vector<Session>& sessions() const noexcept { return sessions_; }
// The weights of all assessments added together (0 if there are none).
[[nodiscard]] int total_weight_percent() const;
// One describe() line per assessment, in the order they were added.
[[nodiscard]] std::vector<std::string> assessment_descriptions() const;
private:
std::string code_;
std::string title_;
const Instructor* lead_; // never null; not owned
std::vector<Session> sessions_; // stored by value: owned, no pointers
// Each element is a unique_ptr to a base class, so one vector can hold
// Exams and Projects side by side. When the course is destroyed, the
// vector destroys each unique_ptr, which deletes its assessment.
std::vector<std::unique_ptr<Assessment>> assessments_;
};

class Course

a course in the catalog

Data members

  • std::string code_;
  • std::string title_;
  • const Instructor* lead_; never null; not owned
  • std::vector<Session> sessions_; owned, by value
  • std::vector<std::unique_ptr<Assessment>> assessments_; owned, through pointers

Member functions

  • Course(std::string code, std::string title, const Instructor& lead);
  • const Instructor& lead() const;
  • void change_lead(const Instructor& lead);
  • void add_session(Session session);
  • void add_assessment(std::unique_ptr<Assessment> assessment);
  • int total_weight_percent() const;

interface (abstract class) Assessment

exams, projects, and any later kind

Data members

  • virtual int weight_percent() const = 0;
  • virtual std::string describe() const = 0;

struct Session

a plain value: no rules of its own

Data members

  • std::string weekday;
  • int start_hour = 9;
  • std::string room;

class Department

Data members

  • std::string name_;
  • std::vector<const Course*> courses_; never null; not owned

Member functions

  • void list(const Course& course);
  • void print_timetable(std::ostream& out) const;
Class outline of the course catalog: the types of the data members show who owns what

The sketch said who owns whom with arrow styles. The outline says the same thing with C++ types, which is more precise:

Data member type Means Sketch arrow
T or std::vector<T> owned, stored inside, destroyed with the owner solid, “owns”
std::unique_ptr<T>, or a container of them owned, stored elsewhere (often because T is a base class) solid, “owns”
std::optional<T> owned when present; may be empty solid, “owns 0..1”
const T* or T* not owned; may be changed to point elsewhere; must outlive the owner dashed, “knows”
T& or const T& member not owned; fixed for the owner’s whole life dashed, “knows”
std::shared_ptr<T> ownership shared with others; destroyed with the last owner solid, “shares”, and say who else shares it
std::weak_ptr<T> not owned; may have been destroyed, so check before use dashed, “knows 0..1”
TId (an ID such as std::string) not owned; looked up elsewhere when needed dashed, “knows”
a parameter, not a data member used during one call only dashed, “uses”

This is why the outline writes the real types, not “a list of sessions”. std::vector<Session> and std::vector<const Course*> are both “a list”, but the first destroys its sessions and the second must never outlive its courses. In C++ that difference is the one most likely to cause a bug.

An outline is a design document, not a copy of the header. Leave out what does not help the reader decide whether the design is right:

  • Getters and trivial helpers (code(), title(), sessions()), unless the question is about the class’s public interface as a whole.
  • Copy and move declarations (Course(const Course&) = delete;), unless copying is the point being discussed.
  • Private helper functions. If one matters, add a note: // private: shared by both checks.
  • [[nodiscard]], noexcept, and override, which matter in the code but not usually in a design discussion.

Include constructors when they establish an invariant or receive an owned or borrowed object, as Course’s does: it shows that a course cannot exist without a lead.

The two drawings describe the same design, so they must agree. Check them against each other:

Sketch arrow Where it is in the outline
Course owns 0..* Session std::vector<Session> sessions_
Course owns 0..* Assessment std::vector<std::unique_ptr<Assessment>> assessments_
Course knows 1 Instructor const Instructor* lead_ (never null), set in the constructor
Department lists 0..* Course std::vector<const Course*> courses_
Exam, Project is an Assessment not in the outline: class Exam final : public Assessment

Every “owns” or “knows” arrow is a data member (or a base class), every “uses” arrow is a parameter, return type, or local variable, and every data member that refers to another class is an arrow. If a member has no arrow, the sketch is missing a connection; if an arrow has no member, the outline is missing data, or the arrow is wrong.

The outline also shows what the sketch cannot: Department never changes a course, because it holds const Course*; and Session is a plain struct, so it has no rules to protect.

Choose by asking who will read this, and which question does it answer?

  • Domain sketch (early, with people who know the domain): an entity sketch with names and words only. No C++. The question: “have we got the concepts and their connections right?”
  • Design outline (before or during implementation): the sketch plus outlines with the data members and the member functions that matter. The question: “who is responsible for what, and who owns whom?”
  • The header file (when every detail matters): the code itself. An outline that lists every member is a worse copy of the header.

Most drawings on this site are design outlines.

Every drawing on this site also has a text equivalent: a paragraph that says the same thing in words, for readers who cannot see the picture. (Outlines are text already.) Writing it is a good test of the drawing: if it is hard to describe, it may be trying to show too much.

A drawing that disagrees with the code is worse than none: readers trust it, and it is wrong. Some habits help:

  • Store drawings as text, next to what they describe. This site keeps each sketch (as Mermaid text) and each outline in the page that explains the code, so a change to the example and to its drawing can be reviewed together.
  • Check them automatically. The site’s checks parse every sketch and every outline on every build, so a syntax mistake fails the build. No check can tell whether a drawing matches the code; that is a review question.
  • Draw less. Every member in an outline is one more thing that can go out of date. Outlines that leave out getters and private helpers survive most changes to private code.
  • Review the drawing when ownership or the public interface changes, not when any line changes. Adding a private helper does not touch the drawing. Changing const Instructor* to std::unique_ptr<Instructor> turns a dashed “knows” arrow into a solid “owns” arrow, and that is exactly the kind of change a reviewer should see.
  • Delete drawings no one needs, such as an early domain sketch once the design outline exists.

Tools exist that draw class diagrams from source code. They are always up to date, but they show everything, including what this page recommends leaving out, and they cannot know intent: a const Course* member could mean “knows one course” or “is one of many that list this course”; only the design says which. They are most useful for exploring an unfamiliar code base.

Books, teams, and some interviewers use UML class diagrams. Here is the course catalog in UML, so that you can see what each symbol corresponds to.

The course catalog as a UML class diagram, for comparison with the sketch and outline above
Text description of the diagram

Seven class boxes. Department has a private attribute name_ and public operations list and print_timetable. Course has private attributes code_ and lead_ (a pointer to an instructor) and public operations change_lead, add_session, add_assessment, and total_weight_percent. Assessment is marked as an interface, with abstract operations weight_percent and describe. A line with a hollow diamond at Department, labelled “lists”, with 0..* at both ends, joins Department and Course. A solid arrow labelled “lead” goes from Course (0..*) to Instructor (1). Lines with filled diamonds at Course join it to Session and to Assessment, each with 1 at Course and 0..* at the other end. Dashed lines with hollow triangles at Assessment come from Exam and Project.

Diagram source (Mermaid)
classDiagram
class Department {
  -name_ string
  +list(course)
  +print_timetable(out)
}
class Course {
  -code_ string
  -lead_ Instructor ptr
  +change_lead(instructor)
  +add_session(session)
  +add_assessment(assessment)
  +total_weight_percent() int
}
class Instructor
class Session
class Assessment {
  <<interface>>
  +weight_percent() int*
  +describe() string*
}
class Exam
class Project
Department "0..*" o-- "0..*" Course : lists
Course "0..*" --> "1" Instructor : lead
Course "1" *-- "0..*" Session
Course "1" *-- "0..*" Assessment
Assessment <|.. Exam
Assessment <|.. Project
UML symbol Name This site’s sketch Typical C++
solid line, filled diamond at the owner composition solid arrow, “owns” member object, container of values, unique_ptr
solid line, hollow diamond at the group aggregation dashed arrow, “lists” or “groups” container of non-owning pointers or IDs
solid arrow towards the known class association dashed arrow, “knows” pointer, reference, or ID member
plain line, no arrowhead association, both ways or not decided two dashed arrows, or a note members on both sides
dashed arrow dependency dashed arrow, “uses” parameter, local variable, return type
solid line, hollow triangle at the base inheritance thick arrow, “is a” class B : public A
dashed line, hollow triangle at the interface realization thick arrow, “implements” class B : public A, A has only pure virtuals
+ / - / # before a member public / private / protected the outline’s notes public: / private: / protected:
* after an operation (italic) abstract = 0 in the outline pure virtual function
$ after a member (underlined) static static in the outline static member
<<interface>>, <<abstract>> stereotype the box’s kind label an abstract class

Three details trip people up when reading UML:

  • Diamonds go at the whole, the owner or the group, never at the part.
  • Multiplicity is written at both ends. Course "0..*" --> "1" Instructor reads: each course has exactly one lead; each instructor leads zero or more courses.
  • UML types are language-neutral. lead_ Instructor ptr does not say whether the pointer owns. In C++ that is the question that matters most, which is one reason this site prefers outlines with real C++ types.
  • Two styles are used for an abstract base class. Some teams draw it with <<interface>> and dashed realization lines, as here, because it has only pure virtual functions; others call it <<abstract>> and use solid inheritance lines. Either is fine if the drawing says which it means.
  • The name comes before the type in Mermaid’s notation (-code_ string), the opposite of a C++ declaration (std::string code_;).
  • Drawing everything. Every class, every member, every std::string. The question the drawing was meant to answer is lost.
  • “Has” for every arrow. “Has” does not say whether one destroys the other. Use “owns” or “knows”, with the matching arrow style.
  • An outline without types. lead_ alone says nothing about ownership; const Instructor* lead_; // not owned says everything.
  • Arrows that are not in the code. A sketch that shows “Course knows Department” when no member exists misleads every reader.
  • Inheritance for “uses”. A thick “is a” arrow means “is a kind of”, nothing else.
  • Drawings that are never updated. If no one will keep it in step with the code, a short paragraph may serve better.

Exercise: Sketch and outline a design from C++ code

The responsibilities lesson wrote a library checkout as four classes. Here are the parts that matter:

VerifiedCompiled and tested with GNU 11.4.0 and Clang 14.0.0 (C++20, 2026-12-01).

catalog.hpp
// One physical copy of a book: its title, and whether it is on the shelf
// right now. A plain struct, because the Catalog is the only class that
// changes it. A new copy starts on the shelf.
struct Copy {
std::string title;
bool on_shelf = true;
};
// Knows: every copy, by copy ID, and whether it is on the shelf.
// Does: adds copies, and records a copy leaving or returning to the shelf.
class Catalog {
public:
// Returns false, changing nothing, if copy_id is already in use.
// Otherwise stores a new Copy, on the shelf, and returns true.
bool add(std::string copy_id, std::string title);
// False for a copy the library does not own, as well as for one that
// is out: an unknown copy is not on the shelf either.
[[nodiscard]] bool is_on_shelf(const std::string& copy_id) const;
// True if a copy with this ID was ever added.
[[nodiscard]] bool owns(const std::string& copy_id) const;
// Precondition: owns(copy_id). Throws std::out_of_range otherwise.
// Each one sets on_shelf (false when lent, true when returned). They do
// not check the old value: knowing whether a copy may be lent is the
// LoanDesk's job, not the catalog's.
void mark_lent(const std::string& copy_id);
void mark_returned(const std::string& copy_id);
private:
// Copies looked up by copy ID ("C-1" -> {"Dune", true}). A std::map
// keeps each key once, so two copies can never share an ID. std::less<>
// makes the comparison "transparent": a lookup could pass another
// string type, such as std::string_view, without building a std::string.
std::map<std::string, Copy, std::less<>> copies_;
};

VerifiedCompiled and tested with GNU 11.4.0 and Clang 14.0.0 (C++20, 2026-12-01).

loan_ledger.hpp
// One open loan: which copy, which member has it, and the day it is due
// back. A plain value: the ledger stores it, and close() hands it back.
struct Loan {
std::string copy_id;
std::string member_id;
int due_day; // day number; the example counts days from an arbitrary start
};
// Knows: every open loan, by copy ID.
// Does: opens and closes loans; counts a member's loans.
class LoanLedger {
public:
// Returns false, changing nothing, if loan.copy_id is already on loan.
// The Loan is taken by value and moved into the map.
bool open(Loan loan);
// Returns the closed loan, or nothing if the copy was not on loan.
// std::optional<Loan> either holds a Loan or is empty (std::nullopt);
// the loan is removed from the ledger and handed back to the caller.
std::optional<Loan> close(const std::string& copy_id);
// How many open loans this member has. It looks at every open loan, so
// it takes time proportional to the number of loans (O(n)).
[[nodiscard]] int count_for(const std::string& member_id) const;
private:
// Open loans looked up by copy ID. One key per copy is what makes "a
// copy can be on loan only once" true: a second open() for the same
// copy finds the key taken. std::less<> works as in Catalog.
std::map<std::string, Loan, std::less<>> by_copy_;
};

VerifiedCompiled and tested with GNU 11.4.0 and Clang 14.0.0 (C++20, 2026-12-01).

loan_desk.hpp
// Every way a checkout can end: lent, or refused for one named reason.
// Refusals are ordinary outcomes (a member asks for a copy that is out), so
// they are returned as values, not thrown as exceptions.
enum class CheckoutResult { lent, no_such_copy, not_on_shelf, member_may_not_borrow };
// Does: carries out checkouts and returns, by asking its collaborators.
// Knows: only the loan period, and who its collaborators are.
class LoanDesk {
public:
// Binds the desk to the caller's catalog and ledger (no copies are made)
// and remembers how many days a loan lasts.
LoanDesk(Catalog& catalog, LoanLedger& ledger, int loan_days) noexcept
: catalog_(catalog), ledger_(ledger), loan_days_(loan_days) {}
// Lends copy_id to member on day `today`, due back loan_days later, or
// says why not. A refusal changes nothing. The member is passed to each
// call, not stored, because one desk serves many members.
CheckoutResult check_out(const MemberAccount& member, const std::string& copy_id, int today);
// Returns false if the copy was not on loan.
// Otherwise closes the loan, puts the copy back on the shelf, and
// returns true.
bool check_in(const std::string& copy_id);
private:
// References, not copies: the desk works on the very catalog and ledger
// that main created. A reference cannot be null or re-pointed, and the
// two objects must outlive the desk.
Catalog& catalog_;
LoanLedger& ledger_;
int loan_days_;
};

MemberAccount has a constructor taking a member ID and a loan limit, the data members std::string member_id_, int loan_limit_, and bool blocked_, and the public functions id(), may_hold(loans_held), block(), and unblock().

  1. Draw an entity sketch of the four classes and the two record types (Copy, Loan). Choose the style and label of each arrow, and say which member or parameter it is.
  2. Write a class outline for LoanDesk, Catalog, and LoanLedger, at design level.
  3. What does the sketch show about coupling that the code does not make obvious?
Show the explained answer

1. Entity sketch.

Entity sketch of the library checkout: the desk knows the catalog and ledger, and uses a member account during a checkout
Text description of the diagram

Six boxes. Dashed arrows labelled “knows 1” go from LoanDesk to Catalog and from LoanDesk to LoanLedger: the desk remembers one of each, without owning them. A dashed arrow labelled “uses during check_out” goes from LoanDesk to MemberAccount: the account is a parameter, not stored. A solid arrow labelled “owns 0..*, by copy ID” goes from Catalog to Copy, and a solid arrow labelled “owns 0..* open loans, by copy ID” goes from LoanLedger to Loan. There are no arrows between Catalog, LoanLedger, and MemberAccount.

Diagram source (Mermaid)
flowchart LR
LoanDesk -.->|knows 1| Catalog
LoanDesk -.->|knows 1| LoanLedger
LoanDesk -.->|uses during check_out| MemberAccount
Catalog -->|"owns 0..*, by copy ID"| Copy
LoanLedger -->|"owns 0..* open loans, by copy ID"| Loan
  • Desk knows catalog and ledger (dashed): the members Catalog& catalog_ and LoanLedger& ledger_. They are references, so the desk does not own them, they must outlive it, and it can never be switched to another catalog.
  • Desk uses member account (dashed): the parameter const MemberAccount& member of check_out. It is not stored.
  • Catalog owns copies, ledger owns loans (solid): the members std::map<std::string, Copy, std::less<>> copies_ and std::map<std::string, Loan, std::less<>> by_copy_. The values are inside the maps and are destroyed with them. The map is not drawn; the label says what the key is.

2. Class outline.

class LoanDesk

the only place that combines catalog, ledger, and member

Data members

  • Catalog& catalog_; not owned; must outlive the desk
  • LoanLedger& ledger_; not owned; must outlive the desk
  • int loan_days_;

Member functions

  • LoanDesk(Catalog& catalog, LoanLedger& ledger, int loan_days);
  • CheckoutResult check_out(const MemberAccount& member, const std::string& copy_id, int today);
  • bool check_in(const std::string& copy_id);

class Catalog

which copies exist, and which are on the shelf

Data members

  • std::map<std::string, Copy, std::less<>> copies_; keyed by copy ID

Member functions

  • bool add(std::string copy_id, std::string title);
  • bool owns(const std::string& copy_id) const;
  • bool is_on_shelf(const std::string& copy_id) const;
  • void mark_lent(const std::string& copy_id);
  • void mark_returned(const std::string& copy_id);

class LoanLedger

the open loans

Data members

  • std::map<std::string, Loan, std::less<>> by_copy_; keyed by copy ID

Member functions

  • bool open(Loan loan);
  • std::optional<Loan> close(const std::string& copy_id);
  • int count_for(const std::string& member_id) const;
Class outline of the library checkout at design level

Left out: MemberAccount::id() (a getter), the fields of Copy and Loan (they are plain records), and the values of CheckoutResult. None of them changes the answer to “who knows whom, and who owns what?” The constructor of LoanDesk is kept, because it is where the desk receives the objects it borrows.

3. Coupling. Every arrow between the main classes leaves the desk. Catalog, LoanLedger, and MemberAccount know nothing about each other, which is the low coupling the responsibilities lesson aimed for: any one of them can change without touching the other two, and the desk is the only class that must know all three.

  • An entity sketch answers “what exists, and who owns or uses whom?” with boxes and arrows labelled in words: solid for owns, dashed for knows or uses, thick for is a. Numbers in a label say how many.
  • A class outline answers “what does each class remember, and what can it do?” with real C++ declarations, so the types show ownership.
  • The two must agree: every owning or knowing arrow is a data member, and every member that refers to another class is an arrow.
  • Choose the level of detail for the reader and the question; leave out getters, copy declarations, and private helpers.
  • Keep drawings as text next to the code, check them automatically, draw less, and review them when ownership or the public interface changes.
  • UML class diagrams express the same ideas with diamonds and triangles; read them with the table on this page.