Start Learning
Javaneer
Back to roadmap
🏛️
Stage 0

SOLID in Practice

Five principles as tools for change, not commandments.

The five SOLID principles as working engineers actually use them - heuristics for code that's easy to change, applied to a messy but real ledger codebase rather than toy examples. Single responsibility, open/closed, Liskov substitution, interface segregation, and dependency inversion - each shown as the fix for a concrete pain.

6 Lessons in this stage1 h 22 min
Start the first lesson

Lessons in this stage

  1. 01

    Principles, Not Rules

    Intermediate

    What SOLID is really for - designing for change - why the principles are heuristics not laws, and the messy ledger codebase we'll improve throughout the path.

    13 min
  2. 02

    Single Responsibility

    Intermediate

    A class should have one reason to change. Cohesion, the many jobs a 'god class' secretly does, and how splitting by responsibility makes code safe to touch.

    14 min
  3. 03

    Open/Closed

    Advanced

    Open for extension, closed for modification: add behavior without editing tested code, using polymorphism and the strategy pattern instead of growing if/else chains.

    14 min
  4. 04

    Liskov Substitution

    Advanced

    Subtypes must be usable through the base type without surprises. The classic square/rectangle trap, behavioral subtyping, and why 'is-a' isn't enough.

    14 min
  5. 05

    Interface Segregation

    Intermediate

    No client should depend on methods it doesn't use. Fat interfaces, the empty method smell, and splitting into focused role interfaces.

    12 min
  6. 06

    Dependency Inversion

    Advanced

    Depend on abstractions, not concretions - so policy doesn't hard-wire to details. The principle that makes code testable and sets up hexagonal architecture.

    15 min