You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 aserialize
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 wouldserialize
the data to exclude this sensitive data.The text was updated successfully, but these errors were encountered: