DSA Factory
All free lessons
OOP and design

Free SOLID and design smells lessons

7 lessons, about 1½ hours in all. Each teaches one idea with a visual, then gives you a problem or a few questions on it. Read the lessons here, then create a free account to practise and keep your progress.

Stage 0Change without pain

  1. Single responsibilityWhy a class should have one reason to change, and how to see the second reason hiding in a class.12 min
  2. Open for extension, closed for modificationHow to add new behaviour by adding code instead of editing working code, and replacing type switches with polymorphism.13 min

Stage 1Substitution and dependencies

  1. Liskov substitutionWhat it takes for a subclass to be safely used wherever its parent is expected, and the behavioural rules beyond the type signature.13 min
  2. Interface segregationWhy clients shouldn't depend on methods they don't use, and how to split a fat interface into role interfaces.11 min
  3. Dependency inversion and injectionWhy high-level code should depend on abstractions, and how passing dependencies in makes code testable and flexible.14 min

Stage 2Spotting trouble

  1. Cohesion and couplingThe two measures behind every principle in this topic, and how to judge a design with them.11 min
  2. Design smells and refactoringThe patterns that tell you a design is going wrong, and the small, safe refactoring that answers each.13 min

All of SOLID and design smells is free

That’s the whole topic, from the first idea to the mastery stage, with no card needed. Create a free account to practise, keep your progress and carry on to the next topic.

Create your free account