What is the preferred convention for structuring view model properties? It is better to use generic or more specific property names?
Let's have a user, the page where this user will be displayed should be altered by user's permission. The view model could be written in two different ways:
{
userName,
userEmail,
isAdmin // show/hide controls according the value of this property
}
or
{
userName,
userEmail,
enableDeleteBtn,
showLogData,
// many more show/enable properties which are set according user's permissions
}
The first approach seems to smaller and easier to write, but it's less generic and the logic of displaying/hiding controls have to be changed if for example new type of user role will be introduced.