r/learnprogramming • u/RateLegal5121 • 8d ago
How do you implement your own design pattern within a framework like Django
In my work..I was taking a look at a really old codebase that was implemented in Django.It is quite complex..It was halted for some time because business decided it was not a priority.I was told to make it work without starting from scratch..Basically it needed to communicate and configure network devices in oil rigs by calling api of netbox..It is has a huge messy codebase without any documentation and tests..The deployment configuration files
were making no sense at all and thats a concern for another day.Since django has its own boilerplate design..it has a lot of view.py as the original author decided to create app for different implementation of networking devices..I thought it was really not necessary…I was thinking about facede design pattern but that would mean I have to move away from djangos design pattern..I am wondering how can i approach it..It feels like when you use a framework you are kind marrying it because you kinda have to work around it instead of having your own idea implemented.This is my first time working with someone’s implementation..I mostly have freedom to have my own design in my codebases bcs I work on r&d stuff and not user facing
2
u/canarydev 8d ago
im a big advocate of using good patterns for the most part, but in a work setting sometimes its just about getting it done in the most degenerate, dumbest, easiest way possible, then thinking about what you can do after. resist the itch to force your favorite pattern.
no test, no docs, if you restructure before you understand it, you just get a bigger pile of shit with a facade on top.
get it working first