stantronic
02/06/2024, 11:56 AMcurioustechizen
02/06/2024, 12:01 PMFooItemView
, FooRow
(but this naming collapsed when we had to change it to a grid view in some cases), FooCell
(reminiscent of iOS UITableViewCell).
In the end I settled on FooItem
because for the UI model I suffix State (FooItemState
).ascii
02/06/2024, 1:20 PMState
for UI model is generally what's expected in Compose land, for other models, e.g. for JSON representation, things can change.
In our case having Item
in the JSON model class added no contextual advantage. FoodItem
and Food
convey the same thing — they're a data representation of food. We don't need to know where & how this data would be used.
It's only on the UI side where it makes sense to use Item
, because then it's immediately obvious that it's meant to be within some form of a list/grid.
Plus, in Room our table name has always been food
, so removing Item
also allowed us to remove @Entity(tableName = "food")
.