The formula that worked best for me is keeping things that belong together close to each other. Each separate feature gets its own folder and has all related components inside: repositories, controllers, utilities, templates etc.
The only rule is to never import anything from siblings: if something needs to be reused it should be moved to the top.
This way, whenever I make changes I always know the exact scope of what those changes might affect. Helps tremendously with debugging!
And lastly, keeping things simple makes everything so much more pleasant to work with! So I avoid fancy abstractions unless they are truly necessary and prefer simple functions to classes.
Ooh, my favourite question!
The formula that worked best for me is keeping things that belong together close to each other. Each separate feature gets its own folder and has all related components inside: repositories, controllers, utilities, templates etc.
The only rule is to never import anything from siblings: if something needs to be reused it should be moved to the top.
This way, whenever I make changes I always know the exact scope of what those changes might affect. Helps tremendously with debugging!
And lastly, keeping things simple makes everything so much more pleasant to work with! So I avoid fancy abstractions unless they are truly necessary and prefer simple functions to classes.
Well written.
It would be great if you post any image of this architecture.
Good point, I think I can make a whole article out of it! Will post here once itβs out too π
Sure waiting for it.
Here it comes, hope you'll find it useful:
dev.to/valeriavg/plug-play-modular...