this post was submitted on 05 Feb 2025
16 points (94.4% liked)
Programming
18101 readers
56 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities [email protected]
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
The models in my project have several ways of doing it. On the server side, there’s a function that accepts data from the DB, and a function that accepts data from the frontend. Same with serializing. One function to serialize the data for the DB and one to serialize for the frontend. On the frontend, it’s simpler, since it only sends/receives to/from the server.
That’s mostly abstracted away in a top level class called “Entity”. It’s only if you need to do something special that you’d reimplement those functions. My data abstraction library is open source at https://nymph.io/ if you wanna check it out. It’s what runs my email service, https://port87.com/.