jeudi 25 juillet 2019

Is okay to have mutiple models/classes for same entity (Different fields)?

Some entities in my application are complex and have many fields that many times I don't need but sometimes I do. Many times in the front end I only see a couple of fields so I was wondering if it is correct to have several models defined for the same entity. Simplified example:

Class PersonModel {
   id
   name
   lastname
}
Class PersonModel {
   id
   name
   lastname
   dni
   childs
   pets
   ...   
}

Aucun commentaire:

Enregistrer un commentaire