levibostian / AndroidBlanky

Create a new Android app fast. Comes pre-installed with libraries you already use.
7 stars 0 forks source link

Use Vo objects as VO objects and Models as Models #76

Closed levibostian closed 2 years ago

levibostian commented 3 years ago

I have done this in the iOS app. VO objects are in-memory only and are converted to and from models. Vos are for json parsing and dislaying in the UI while models are only used for storing in the database.

Why? VOs can have lots and lots of properties, default values, null values, models can be dedicated to what we need to store in the DB, and that's it. 2 different purposes so 2 different models. Also, I have had issues in the past with older libraries like Realm where having models floating around in memory and being manipulated in the UI causes problems. Just having immutable VOs being passed around the app is no problem for any library and cheap!