Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Written by Prashant Basnet
👋 Welcome, You’ve Landed on My Signature Page.
I’m a Software Development Engineer passionate about building scalable systems and solving problems.
Beyond engineering, I enjoy sharing ideas and documenting lessons so others can learn and build on them.This space is my digital notebook, a place where I reflect on what I’m learning and creating.
When a project starts, life is simple. You know how things are wired, and adding a new feature feels effortless. But as the system grows, that mental model collapses. Without design patterns, codebases slip into chaos.
Even if you are following MVC pattern, if you don't have proper design patterns in place, it's easy to create a mess.
The Buckets of Backend Code
Most backend logic falls into these buckets:
There is two thing we can do about it,
Design Pattern Buckets
There are 3 fundamental buckets of designing principle.
We’ll focus on one of the most useful creational patterns: the Factory Pattern.
The Factory Pattern
A Factory centralizes object creation so that services, repositories, and infrastructure are instantiated once and reused everywhere.
usage:
Anywhere you need a service, you don’t build it yourself.
If you need a bike, you don’t start by welding the frame, bolting the wheels, and tuning the gears. You just walk into the shop and get a bike. The factory already did the complex, messy work of assembling it.