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

Five letters, one shop (SOLID)

Five Letters, One Shop
Five Letters, One Shop · Open board

One till, broken five ways, one SOLID rule per break, and the fake card that proves the last one.

Before you start. Four words from earlier in the track come back here. A class is a blueprint for objects. A method is an action an object can do. An interface is the small set of actions a class shows to callers. To inherit is to be declared a kind of a parent class and get all its methods. Holding a part (composition) is keeping another object inside and passing requests to it. The object that keeps its own rules (encapsulation and invariants) showed a class guarding its own rules behind a small front. Has-a beats is-a (composition over inheritance) showed the choice between holding a part and inheriting, and the warning that a child must keep every promise its parent made. You also need to read a little Python.

Lesson 38 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

  • SOLID: five rules, named by their first letters
  • The shop that does everything: single responsibility
  • A new discount means opening the old code: open/closed
  • The discount that lies: Liskov substitution
  • The interface that asks for too much: interface segregation
  • The shop that builds its own till: dependency inversion

Terms it explains: class, method, interface, inherit, SOLID, single responsibility, open/closed, Liskov substitution, interface segregation, dependency inversion, Add a staff discount.

Review System Design