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 to my Signature, a space between logic and curiosity.
I’m a Software Development Engineer who loves turning ideas into systems that work beautifully.
This space captures the process: the bugs, breakthroughs, and “aha” moments that keep me building.
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.