Phase 5 of 9 · 9 lessons

Low-level design: OOP and SOLID

The building blocks of good class design: the four pillars of OOP, composition over inheritance, the five SOLID principles, class diagrams, and the concurrency basics LLD questions expect.

Low-level design is about code that's easy to change. SOLID is a set of reasons to split or join classes; patterns (next phase) are proven shapes that follow those reasons. Learn the 'why' here, and the patterns will make sense.

0 of 9 done

Lessons, in order

  1. 5.1

    OOP: the four pillars

    Must know

    Object-oriented programming organises code into objects that bundle data and behaviour. Its four pillars are encapsulation, abstraction, inheritance and polymorphism.

  2. 5.2

    Composition over inheritance, and interfaces

    Must know

    Composition means building a class out of other objects it has ('has-a'), instead of inheriting from a parent ('is-a').

  3. 5.3

    SOLID: S — Single Responsibility Principle

    Must know

    A class should have one reason to change: one job.

  4. 5.4

    SOLID: O — Open/Closed Principle

    Must know

    Code should be open for extension but closed for modification: add new behaviour by adding code, not by editing code that already works.

  5. 5.5

    SOLID: L — Liskov Substitution Principle

    Must know

    Objects of a subclass must work anywhere the parent class is expected, without breaking the program.

  6. 5.6

    SOLID: I — Interface Segregation Principle

    Must know

    Clients shouldn't be forced to depend on methods they don't use. Prefer several small, focused interfaces over one big one.

  7. 5.7

    SOLID: D — Dependency Inversion Principle

    Must know

    High-level code should depend on abstractions, not on concrete low-level details.

  8. 5.8

    UML class diagrams and relationships

    Should know

    A class diagram shows the classes, their fields and methods, and how they relate to each other.

  9. 5.9

    Concurrency basics: threads, locks and race conditions

    Should know

    Concurrency is several tasks making progress at the same time. A race condition is a bug where the result depends on the exact timing between them.