Skip to content
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

Create better abstractions to decouple from db layer #33

Open
supermacro opened this issue Feb 16, 2020 · 0 comments
Open

Create better abstractions to decouple from db layer #33

supermacro opened this issue Feb 16, 2020 · 0 comments
Labels
architecture Architectural question / note / concern / suggestion

Comments

@supermacro
Copy link
Member

Look into domain modelling so as to not model objects based on how they're modelled on the database layer.

Perhaps consider having a models folder as an abstraction over the db.

Examples of its benefits:

Imagine having a Admin model where I could call a serialize method which represents the representation of the model that I'd like to send to the front end.

This is a nice pattern because I can encode into each model what is "exposable" data and what is "non-exposable" / irrelevant / sensitive data (in the context of the front end).

Best example being password. You don't want to send over user passwords over the network. So you would serialize the data to exclude this sensitive data.

@supermacro supermacro added the architecture Architectural question / note / concern / suggestion label Feb 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture Architectural question / note / concern / suggestion
Projects
None yet
Development

No branches or pull requests

1 participant