Why Middleware Beats DI for SaaS Extension Points

In multi-tenant SaaS applications, custom middleware gives you the earliest hook in the request pipeline, even before dependency injection kicks in. Middleware runs at the very beginning of your pipeline, providing access to raw request data before any transformations occur.

August 24, 2025 · Last modified: August 28, 2025 · 9 min

Refactoring Code for Better Coupling and Cohesion

TL;DR: High cohesion means classes focus on one job. Low coupling means classes don’t depend too much on each other. When I refactor messy code, these two principles guide every decision I make. Why I Focus on Cohesion and Coupling When Refactoring After 10+ years of building enterprise applications, I’ve inherited my fair share of messy codebases. The pattern is always the same: tangled classes doing too much, components that break when you touch something seemingly unrelated, and tests that require half the application to run. ...

August 4, 2025 · Last modified: September 19, 2025 · 7 min
×