Design Principles & SOLID
Master SOLID (SRP, OCP, LSP, ISP, DIP) plus DRY, KISS, YAGNI and composition over inheritance — each principle with a bad-vs-good example, a runnable Kotlin demo, a graded exercise, and a class-diagram animation in the Visualize tab.
- Step 1
Clean design principles: an overview
Names for the forces that keep code soft
Start lesson - Step 2
Single Responsibility Principle
One class, one reason to change
Start lesson - Step 3
Open/Closed Principle
Open for extension, closed for modification
Start lesson - Step 4
Liskov Substitution Principle
A subtype must work anywhere its base type is expected
Start lesson - Step 5
Interface Segregation Principle
Many small roles beat one fat interface
Start lesson - Step 6
Dependency Inversion Principle
Depend on abstractions, not concretions
Start lesson - Step 7
DRY — Don't Repeat Yourself
Every fact lives in exactly one place
Start lesson - Step 8
KISS & YAGNI
Build for today, not for an imagined tomorrow
Start lesson - Step 9
Composition over Inheritance
Build objects from swappable parts (has-a), not deep class trees (is-a)
Start lesson - Step 10
Capstone: refactor a God-class to SOLID
One class, four jobs — split it, inject it, extend it
Start lesson