Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

Launch price

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year, or $19.50 for your first year with LAUNCH50, ends 1 Nov, 18:30 UTC.

See plansStart free instead

Module 08 · System Design · Low-level design: classes, properly

The object that keeps its own rules (encapsulation and invariants)

The Object That Keeps Its Rules
The Object That Keeps Its Rules · Open board

The open counter that goes below zero, the teller behind glass who refuses, and a thousand steps with and without the guard.

Before you start. You need the habit from Nouns and verbs (from requirements to classes): turning a spoken requirement into a list of classes and the job each one does. Here we open one of those classes and ask who is allowed to touch what is inside. You also need to read a little Python, and only a little. The one word to carry is class: a blueprint for objects, saying what each one remembers and what it can do.

Lesson 36 of 73 in System Design

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year, or $19.50 for your first year with LAUNCH50, ends 1 Nov, 18:30 UTC.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • An account anyone can reach into: state
  • The invariant: a sentence that must stay true
  • Glass at the counter: the interface
  • 1972: information hiding, hiding the decision most likely to change
  • The honest limit: a wall that politeness holds

Terms it explains: class, state, invariant, interface, encapsulation, information hiding, caller.

Review System Design