Design Patterns
Every post filed under Design Patterns, newest first.
The Single Responsibility Principle Isn't About One Thing
The Single Responsibility Principle is the most misread rule in SOLID: it was never about doing one thing, but about having one clear reason to change.
Design Patterns30 viewsDependency Injection: Stop Building Your Own Dependencies
The moment a class builds its own collaborators, it quietly turns untestable and rigid. Dependency injection is the small habit that fixes both.
Design Patterns68 viewsThe Factory Pattern: When `new` Isn't Enough
Sometimes deciding which object to create is a job in itself. The Factory pattern gives that decision one home so the rest of your code stays simple.
Design Patterns23 viewsThe Strategy Pattern in Plain Code: Kill Your if/else Chains
A growing if/else chain that switches on a type is a design pattern in disguise. Here's how the Strategy pattern turns it into small, swappable pieces.
Design Patterns33 viewsComposition Over Inheritance, Explained With a Real Example
Inheritance looks tidy until the hierarchy fights you. Here's the concrete point where 'is-a' breaks and 'has-a' scales, shown with real code.
Design Patterns22 views
