DEV Community


Discussion on: Do I really need to create classes in two places?

hugo__df profile image
Hugo Di Francesco

"While I don't have a big application, I still feel as though I am doing this wrong." You're not doing it wrong, it's "normal" to have to re-create some sort of model on the client (android, iOS, web frontend).

What could help you is sharing the data class (eg. Using JS for the apps and the backend) although that gets super tricky quite quickly.

Another way is to share some sort of JSON API spec from which your data models are constructed in the apps, again complicated and is probably more effort than its worth.