Category
solid principles
6 articles across 3 sub-topics
Simplifying Code with the Single Responsibility Principle
TLDR TLDR: The Single Responsibility Principle says a class should have only one reason to change. If a change in DB schema AND a change in email format both require you to edit the same class, that class has two responsibilities — and needs to be s...
Interface Segregation Principle: No Fat Interfaces
TLDR TLDR: The Interface Segregation Principle (ISP) states that clients should not be forced to depend on methods they don't use. Split large "fat" interfaces into smaller, role-specific ones. A RoboticDuck should not be forced to implement fly() j...
How the Open/Closed Principle Enhances Software Development
TLDR TLDR: The Open/Closed Principle (OCP) states software entities should be open for extension (add new behavior) but closed for modification (don't touch existing, tested code). This prevents new features from introducing bugs in old features. ...
Dependency Inversion Principle: Decoupling Your Code
TLDR TLDR: The Dependency Inversion Principle (DIP) states that high-level business logic should depend on abstractions (interfaces), not on concrete implementations (MySQL, SendGrid, etc.). This lets you swap a database or email provider without to...
