-
-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tech debt - service dao layers for api #921
Comments
Sounds like a good idea, do you have any resources where we can read more about this architecture? |
Hey Viktor There also clean architecture that's similar but implements some other differing principals, this article seems to cover the basics, https://dev.to/eminetto/clean-architecture-using-golang-5791 I'd be suggesting using the closed service principal (if using a layered approach) where everything must pass through a service to get to the dao. Googling layered architecture and clean architecture, willl lead you to many stack overflow, blog pages etc. about the subjecr |
Issue
The db is the core area passed throughout the code base. Nothing is currently broken away into segregation of layers. This poses the downside of everything being mixed together. In some places this is fine however in some places I've noticed it has lead to duplication or more confusing flows. For the long term stability and improvement of the product I'm suggesting to use the service & dao layered architecture.
Fix
Refactor (over time) and introduce new code guidelines to use the service dao layer for the application. commonly called service and repository in the go world. This doesn't need to be done overnight. Enforcing a coding standard going forward will lead to gradual refactorings over time. And areas which are less commonly touched can be broken out specifically in smaller chunks and PR's.
Benefits
Faster change, better centralization of logic easier to break away from the api in the future if ever desired.
The text was updated successfully, but these errors were encountered: