SOLID Principles
6 topics · Stage 2
Complete
- 01SRP - The Single Responsibility PrincipleA class should have one reason to change, which really means one group of people who would ask you to change it.11 min
- 02OCP - The Open/Closed PrincipleAdd new behaviour by adding new code, not by editing code that already works. Usually one interface and one class per variant.10 min
- 03LSP - The Liskov Substitution PrincipleIf code works with a base type, it must keep working with any subtype. No surprise exceptions, no stricter inputs, no weaker promises.11 min
- 04Interface Segregation Principle (ISP)No caller should be forced to depend on methods it never uses. Split fat interfaces by the role each caller plays.8 min
- 05Dependency Inversion Principle (DIP)Business logic should not depend on details like SMS vendors or databases. Both depend on an interface that the business side owns.11 min
- 06Beyond SOLID: DRY, KISS, YAGNI and FriendsDRY, KISS, YAGNI, Law of Demeter, Tell Don't Ask, fail fast and the rest, with small Java examples and where each one goes too far12 min